L
lightning
I put some encrypted token in the cookie, and I set a expiration of
half an hour .
In order to avoid the cookie dies and the user get automately logged
out,
I use reponse.addCookie() to reset the cookie's expiration to half an
hour .
the code I use is just like below:
public long getId(String name) {
Cookie[] cookies = request.getCookies();
if (cookies != null) {
for (Cookie i : cookies) {
if (i.getName().equals(name)) {
i.setMaxAge(ConfigServlet.cookie_expire);
response.addCookie(i);
return MagicUtil.getIdFromMagicNo(i.getValue());
}
}
}
return -1l;
}
But I found that my browser IE6 send 5 cookie back to me, two pair has
the same name.
Cookie: magicno=-6568942197980035062.59357; magicinfo=MDYgNyskKCB/
ISEh; JSESSIONID=5C771E6A3CC321D842A7344BE49C2A81;
magicno=-6568942197980035062.59357; magicinfo=MDYgNyskKCB/ISEh
Is this because IE6 sucks or what I do is not right?
half an hour .
In order to avoid the cookie dies and the user get automately logged
out,
I use reponse.addCookie() to reset the cookie's expiration to half an
hour .
the code I use is just like below:
public long getId(String name) {
Cookie[] cookies = request.getCookies();
if (cookies != null) {
for (Cookie i : cookies) {
if (i.getName().equals(name)) {
i.setMaxAge(ConfigServlet.cookie_expire);
response.addCookie(i);
return MagicUtil.getIdFromMagicNo(i.getValue());
}
}
}
return -1l;
}
But I found that my browser IE6 send 5 cookie back to me, two pair has
the same name.
Cookie: magicno=-6568942197980035062.59357; magicinfo=MDYgNyskKCB/
ISEh; JSESSIONID=5C771E6A3CC321D842A7344BE49C2A81;
magicno=-6568942197980035062.59357; magicinfo=MDYgNyskKCB/ISEh
Is this because IE6 sucks or what I do is not right?