문제

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.

도움이 되었습니까?

해결책

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!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top