不工作我增加了值使用饼干在Internet Explorer
Cookie testcookie = new Cookie ("test",test);
testcookie .setMaxAge(5*60);
response.addCookie(testcookie) ;
到Cookie,但我没有收到在Internet Explorer中的cookie的值。获得cookie值
Cookie cookies [] = getRequest().getCookies();
Cookie myCookie = null;
if (cookies != null)
{
for (int i = 0; i < cookies.length; i++)
{
if (cookies [i].getName().equals ("test"))
{
myCookie = cookies[i];
String testval=myCookie.getValue();
}
}
}
,但在Firefox相同的作品,cooies在IE.How启用的 代码来解决这个问题?
你确定你正在访问相同的域名。即http://site.com,而不是http://www.site.com – Bozho 2010-01-15 08:32:02
可能的副本http://stackoverflow.com/questions/361231/persistent-cookies-from-a-servlet-in-ie和http://stackoverflow.com/questions/1716555/setting-persistent-cookie-from-java-doesnt-work-in-ie – skaffman 2010-01-15 08:37:48
雅重复的问题,但我没有得到解决方案 – sarah 2010-01-15 08:56:53