开发者

delete cookies using javascript

开发者 https://www.devze.com 2023-01-15 17:36 出处:网络
Iam working on Asp.Net Mvc and am creating a cookie usingin one page.I want when a user moves to her page the cookie gets deleted.Further开发者_JAVA技巧 if the same page (in cookie was created) is ref

I am working on Asp.Net Mvc and am creating a cookie using in one page.I want when a user moves to her page the cookie gets deleted.Further开发者_JAVA技巧 if the same page (in cookie was created) is refreshed the cookie should not be deleted.How can i achieve this.


quirksmode.org has some pretty handy functions for creating/reading/manipulating/deleting cookies.


When you're creating the cookie, set the expires like this:

document.cookie="cookie_name=cookie_value; expires=Thu, 01-Jan-1970 00:00:01 GMT";
0

精彩评论

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