문제

I have a strange problem. I want to check if .ASPXAUTH cookie exists with javascript. I do it like this:

authx = document.cookie.indexOf(".ASPXAUTH" + "=");  

and the 'authx' value is always -1. But if I tray to find some other cookie like:

foo = document.cookie.indexOf("bar" + "=");  

it works. Is there some restriction between javascript and .ASPXAUTH cookie???

도움이 되었습니까?

해결책

I solved it. The problem was, that I had set the

HttpOnly = true;  

which prevents the javascript accessing the cookie. I just set it to false and it works.

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