Frage

My code is as simple as the line

document.cookie = "loggedIn=; expires=Thu, 01 Jan 1970 00:00:00 GMT";

I check the cookies before it and loggedIn=true, then I check after and it still exists... I am using Chrome 34.

War es hilfreich?

Lösung

Fixed it!

The issue was I did not include the path in the string, although I am not sure why the path is needed, I thought it would use the default...

document.cookie = "loggedIn=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT";

The above works!

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top