不工作我增加了值使用餅乾在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