문제

Can the Jquery Cookie plugin only read cookies that it sets?

I am using an IFrame to display a page inside a jQuery Mobile page (date-role="page). The Iframe, uses a page that is asp.net forms authenticated. I want to check if the cookie exists and has not expired before navigating to the page. This way I can handle the login process only if the cookie does not exist. Is this possible?

I am trying to read the cookie as such

alert( $.cookie("example") );
도움이 되었습니까?

해결책

Its a different domain. This wont always be the case however

This is the problem in this case - cookies can only be read from the same domain as they were set. This is a security feature which is present in every browser.

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