views:

155

answers:

6

I have a web app that authenticates against a SQL DB and sets a cookie with credentials, like a "remember me" sort of thing. Part of the app involves using a bookmarklet to add things into your personal slice of another DB. This works fine if you authenticate and, in the SAME TAB, begin using the bookmarklet. However, if you authenticate and then attempt to use the bookmarklet within another tab instance the system acts as if you're not logged in. I've done everything I can think of to try and track this issue. I realize it might be a long shot without posting extensive app code, but does this sound familiar? The cookie is set for "/", so it should apply to anywhere you may wander within the app.

Firefox and Safari for OS X/ Windows, by the way. Thanks.

A: 

What do you see if you examine the cookie from the bookmarklet code? Maybe you need to explicitly pass it in the POST.

PEZ
+1  A: 

I would use the Firefox extension LiveHTTPHeaders to view the headers and verify that the cookie is being sent.

ejunker
A: 

Does the bookmarklet make remote requests itself, or does it call code already rendered on the page to make remote requests?

Beau Simensen
A: 

Are you setting the cookie in JavaScript? If so it'll only be valid for that tab.

Max
A: 

What is the expiration time of cookie?

Malx
A: 

Check the network.cookie.cookieBehavior config setting in FireFox

Malx