Project

General

Profile

Actions

Bug #7386

closed

Incorrect Expires date generation when locale is different from en_US

Added by Henry Morgan almost 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
01/01/2020
Due date:
% Done:

0%

Estimated time:

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.

Actions #1

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);

}

Actions #2

Updated by Roel Standaert almost 5 years ago

  • Status changed from New to Resolved

I pushed a fix

Actions #3

Updated by Roel Standaert almost 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF