[#712] Fix parsing dates in the past bug in CookieDecoder

This commit is contained in:
Norman Maurer 2012-11-08 09:38:32 +01:00
parent 1a7e7a1bff
commit 90c0481ecf

View File

@ -120,11 +120,9 @@ public final class CookieDecoder {
long maxAgeMillis =
new HttpHeaderDateFormat().parse(value).getTime() -
System.currentTimeMillis();
if (maxAgeMillis <= 0) {
maxAge = 0;
} else {
maxAge = maxAgeMillis / 1000 + (maxAgeMillis % 1000 != 0? 1 : 0);
}
maxAge = maxAgeMillis / 1000 + (maxAgeMillis % 1000 != 0? 1 : 0);
} catch (ParseException e) {
// Ignore.
}