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

This commit is contained in:
Norman Maurer 2012-11-08 10:02:50 +01:00
parent 88c2200264
commit 55457691d2

View File

@ -134,12 +134,10 @@ public class CookieDecoder {
long maxAgeMillis =
new CookieDateFormat().parse(value).getTime() -
System.currentTimeMillis();
if (maxAgeMillis <= 0) {
maxAge = 0;
} else {
maxAge = (int) (maxAgeMillis / 1000) +
(maxAgeMillis % 1000 != 0? 1 : 0);
}
maxAge = (int) (maxAgeMillis / 1000) +
(maxAgeMillis % 1000 != 0? 1 : 0);
} catch (ParseException e) {
// Ignore.
}