JQuery cookie access has stopped working for GAE app

Posted by Greg on Stack Overflow See other posts from Stack Overflow or by Greg
Published on 2010-04-26T21:06:36Z Indexed on 2010/04/26 21:33 UTC
Read the original article Hit count: 253

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('dev_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?

© Stack Overflow or respective owner

Related posts about python

Related posts about jQuery