eyalw
eyalw

Reputation: 740

AJAX and browser GET calls appear to have different cookies

I have 2 pages, a static html page and a python script - hosted on [local] google app engine.

/html/hello.html define as login: required

/broadcast which is a python script

when I access hello.html for the first time I am redirected to login page, I sign in, and then redirected back to hello.html.

inside hello.html - an AJAX call with jQuery is executed to load data from '/broadcast', this call errors saying 'you're not logged in'! BUT - the same call to '/broadcast' through the browser address field succeeds as if I AM signed in!

as if the ajax and the browser callers have different cookies!??

HELP, am I going bananas?

Upvotes: 0

Views: 98

Answers (1)

eyalw
eyalw

Reputation: 740

Stupid me...

The ajax call was to localhost/broadcast and the browser address field was 127.0.0.1/broadcast

... the cookies for "different" domains ('127.0.0.1' != 'localhost') are not shared ofcourse...

Then I haven't gone mad...

Upvotes: 2

Related Questions