开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜