How to remove a cookie by using Javascript?

P

Phper

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

The following statement doesn't work.
javascript:void
(document.cookie=”PREF=ID=20b6e4c2f44943bb:U=4bf292d46faad806:TM=1249677602:LM=1257919388:S=odm0Ys-53ZueXfZG;expires=Thu,
01 Jan 1970 00:00:00 GMT;path=/; domain=.google.com”);
What's wrong with the code?
 
M

Matthias Reuter

Phper said:
How to remove the cookie set by
javascript:void
(document.cookie=â€PREF=ID=20b6e4c2f44943bb:U=4bf292d46faad806:TM=1249677602:LM=1257919388:S=odm0Ys-53ZueXfZG;path=/;
domain=.google.comâ€);

The following statement doesn't work.
javascript:void
(document.cookie=â€PREF=ID=20b6e4c2f44943bb:U=4bf292d46faad806:TM=1249677602:LM=1257919388:S=odm0Ys-53ZueXfZG;expires=Thu,
01 Jan 1970 00:00:00 GMT;path=/; domain=.google.comâ€);
What's wrong with the code?

You cannot set cookies for other domains than the one your script runs on.
So if your script does not run somewhere on .google.com, the browser
ignores your request to set a cookie for that domain.

Matt
 
Z

Zigurds

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

The following statement doesn't work.
javascript:void
(document.cookie=”PREF=ID=20b6e4c2f44943bb:U=4bf292d46faad806:TM=1249677602­:LM=1257919388:S=odm0Ys-53ZueXfZG;expires=Thu,
01 Jan 1970 00:00:00 GMT;path=/; domain=.google.com”);
What's wrong with the code?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top