如何从Cookie中删除信息? [英] How can delete information from cookies?
问题描述
我已经使用webservice到我的应用程序,并希望删除信息保存在一个状态的cookie,并且必须删除在特定条件下的另一个状态。我怎么能这样做?
感谢
检查
http://www.ehow.com/how_5169279_remove-cookies-java.html
如何
可以使用以下脚本小程序删除cookie mycookie:
<%
Cookie killMyCookie = new Cookie(mycookie,null);
killMyCookie.setMaxAge(0);
killMyCookie.setPath(/);
response.addCookie(killMyCookie);
%>
如何删除servlet设置的cookie? >
从请求对象中获取cookie,并使用 setMaxAge(0)
,然后将cookie添加到响应对象。 p>
http://www.hccp.org /java-net-cookie-how-to.html
i have used webservice into my application and want to delete information from cookies that is saved on one state and must be deleted on another state on particular condition given. How can i do so? Thanks
check http://www.ehow.com/how_5169279_remove-cookies-java.html
How can I delete a cookie from within a JSP page?
A cookie, mycookie, can be deleted using the following scriptlet:
<%
Cookie killMyCookie = new Cookie("mycookie", null);
killMyCookie.setMaxAge(0);
killMyCookie.setPath("/");
response.addCookie(killMyCookie);
%>
How do I delete a cookie set by a servlet?
Get the cookie from the request object and use setMaxAge(0)
and then add the cookie to the response object.
http://www.hccp.org/java-net-cookie-how-to.html
这篇关于如何从Cookie中删除信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!