开发者

JQuery cookie access has stopped working for GAE app

开发者 https://www.devze.com 2022-12-28 11:20 出处:网络
I have a google app engine app that has been running for some time, and some javascript code that checks for a login cookie has suddenly stopped working. As far as I can tell, NO code has changed.

I have a google app engine app that has been running for some time, and some javascript code that checks for a login cookie has suddenly stopped working. As far as I can tell, NO code has changed.

The relevant code uses the jquery cookies plugin (jquery.cookies.2.2.0.min.js)...

// control the default screen depending
// if someone is logged in
if( $.cookies.get('d开发者_如何转开发ev_appserver_login') != null || $.cookies.get('ACSID') != null ) {
   alert("valid cookie!")
   $("#inventory-container").show();
} else {
   alert("INvalid cookie!")
   $("#welcome-container").show();
}

The reason for the two checks is that in the GAE SDK, the cookies are named differently. The production system uses 'ACSID'.

This if statement works in the SDK and now fails 100% of the time in production. I have verified that the cookie is, in fact, present when I inspect the page.

Thoughts?


Possibly the ACSID cookie is now being marked as 'secure', and hence unavailable to Javascript. Why the devil are you doing this in the first place, though?

0

精彩评论

暂无评论...
验证码 换一张
取 消