I have a cookie which is generated from a servlet and that I would like to be persistent - that is, set the cookie, close down IE, start it back up, and still be able to re
I had a similar issue with IE8 as well, except that the cookie was persisting when using http but not when using https. Intellectual Tortoise's solution worked for me, as I had '=' and other chars in there that were screwing it up. Before I encoded the https cookie, it showed as expiring at "End of session". After encoding the value, it expired with the maxAge I passed in. Here's the methods I used to encode/decode the cookie value before setting and after retrieving it:
public static String encodeString(String s) {
String encodedString = s;
try{
encodedString = URLEncoder.encode(s, "UTF-8");
} catch (UnsupportedEncodingException e) {}
return encodedString;
}
public static String decodeString(String s) {
String decodedString = s;
try{
decodedString = URLDecoder.decode(s, "UTF-8");
} catch (UnsupportedEncodingException e) {}
return decodedString;
}