views:

74

answers:

1

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?

A: 

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?

Nick Johnson
good question, nick. :) i admit, it was an intermediate hack on my part that managed to weave its way into common practice on a couple of pages.you've motivated me to remove it. although the problem is gone for me now, the mystery remains as to why it suddenly stopped working...
Greg