Merge pull request #888 from gerbermichi/master
Bugfix: Changed timezone to GMT so IE can store cookie
This commit is contained in:
commit
f620b04656
1 changed files with 8 additions and 5 deletions
|
@ -122,20 +122,23 @@ public class ServerCookie implements Serializable {
|
||||||
private final static String OLD_COOKIE_PATTERN = "EEE, dd-MMM-yyyy HH:mm:ss z";
|
private final static String OLD_COOKIE_PATTERN = "EEE, dd-MMM-yyyy HH:mm:ss z";
|
||||||
|
|
||||||
|
|
||||||
private final static DateFormat oldCookieFormat = new SimpleDateFormat(OLD_COOKIE_PATTERN, LOCALE_US);
|
private final static DateFormat OLD_COOKIE_FORMAT = new SimpleDateFormat(OLD_COOKIE_PATTERN, LOCALE_US);
|
||||||
|
static{
|
||||||
|
OLD_COOKIE_FORMAT.setTimeZone(GMT_ZONE);
|
||||||
|
}
|
||||||
|
|
||||||
public static String formatOldCookie(Date d) {
|
public static String formatOldCookie(Date d) {
|
||||||
String ocf = null;
|
String ocf = null;
|
||||||
synchronized (oldCookieFormat) {
|
synchronized (OLD_COOKIE_FORMAT) {
|
||||||
ocf = oldCookieFormat.format(d);
|
ocf = OLD_COOKIE_FORMAT.format(d);
|
||||||
}
|
}
|
||||||
return ocf;
|
return ocf;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void formatOldCookie(Date d, StringBuffer sb,
|
public static void formatOldCookie(Date d, StringBuffer sb,
|
||||||
FieldPosition fp) {
|
FieldPosition fp) {
|
||||||
synchronized (oldCookieFormat) {
|
synchronized (OLD_COOKIE_FORMAT) {
|
||||||
oldCookieFormat.format(d, sb, fp);
|
OLD_COOKIE_FORMAT.format(d, sb, fp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue