开发者

How to reverse the effect of the following execution by using Javascript? [duplicate]

开发者 https://www.devze.com 2022-12-12 08:23 出处:网络
This question already has answers here: Closed 10 years ago. Possible Duplicate: How to remove a cookie by using Javascrip开发者_运维百科t?
This question already has answers here: Closed 10 years ago.

Possible Duplicate:

How to remove a cookie by using Javascrip开发者_运维百科t?

javascript:void(document.cookie=”PREF=ID=20b6e4c2f44943bb:U=4bf292d46faad806:TM=1249677602:LM=1257919388:S=odm0Ys-53ZueXfZG;path=/; domain=.google.com”);

How to eliminate the result of the statement above by writing another Javascript statement?


To remove a cookie, do the same thing but set an expire date in the past:

In this case:

document.cookie=”PREF=ID=20b6e4c2f44943bb:U=4bf292d46faad806:TM=1249677602:LM=1257919388:S=odm0Ys-53ZueXfZG; expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/; domain=.google.com”

The key is the addition of expires=Thu, 01 Jan 1970 00:00:01 GMT;

0

精彩评论

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