Bug #7386
closedIncorrect Expires date generation when locale is different from en_US
0%
Description
jwt generates wrong expiration date among cookies when locale is set to the value different from en_US. It causes creation of session cookie instead of cookie with lifetime or inaccessibility of site at all(for chrome). You may set locale to ru_RU.utf8 to reproduce this error. So it violates RFC 6265 requirements.
Updated by Henry Morgan almost 5 years ago
Here's your code at WDate:
public String toString(String format) {
SimpleDateFormat formatter = new SimpleDateFormat(format);
return formatter.format(this.d);
}
public String toString(String format, boolean localized) {
return toString(format);
}
Should be:
public String toString(String format)
{
return toString(format, true);
}
public String toString(String format, boolean localized)
{
SimpleDateFormat formatter = null;
if (localized)
{
formatter = new SimpleDateFormat(format);
}
else
{
formatter = new SimpleDateFormat(format, Locale.ENGLISH);
}
return formatter.format(this.d);
}
Updated by Roel Standaert almost 5 years ago
- Status changed from Resolved to Closed