开发者

Remove HTTP_COOKIE cookie from browser

开发者 https://www.devze.com 2023-01-15 19:23 出处:网络
How can I remove an HT开发者_如何学JAVATP_COOKIE cookie from the browser using classic ASP?Response.Cookies(\"cookie_name\").Expires = DateAdd(\"d\",-1,Now())

How can I remove an HT开发者_如何学JAVATP_COOKIE cookie from the browser using classic ASP?


Response.Cookies("cookie_name").Expires = DateAdd("d",-1,Now())


A cookie is a user's property once it is sent to his computer. you cannot actually remove it manually from his/her computer as this would lead to security flaws. So the solution is using the expire property of a cookie. For example setting the cookie's expires property to a previous or older time, ensures that the browser automatically deletes/discards the cookie. For eg:

 myCookie.Expires = DateTime.Now.AddDays(-1d);
0

精彩评论

暂无评论...
验证码 换一张
取 消