Resetting Cookie value with future expiration date
Hi.
I am trying to reset last_accessed cookie value with a new timestamp
every time the page refreshes, and set the new future expiration date
(1 year ahead). The code below doesn't reset the cookie value. What
is the cleanest way to go about it?
final Date now = new Date();
now.setYear(now.getYear() + 1);
final String s = String.valueOf((new Date()).getTime());
Cookies.setCookie("last_accessed", s, now);
Cookies.getCookie("last_accessed"); // prints the same value over and
over
Thanks,
-Viktoriya
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home