frdrck / Pomme

The github for Pomme.us
http://pomme.us
4 stars 0 forks source link

cookies don't stay in their jar #10

Open geluso opened 12 years ago

geluso commented 12 years ago

I can run the server and the client on my local machine. However, I have trouble logging in. It seems that things are not actually being added to my cookies.

Lines 272-273 in the lobby seem to try to write the session to the cookie, yet when I print the cookie to the console immediately after, I do not see the session within it. After logging in, I'm redirected to the bigapple room and prompted to log in again.

''' document.cookie = "session="+Auth.session+";path=/;domain=." + BROWSER + ";max-age=1086400"; console.log(document.cookie); '''

Anyone else having this trouble logging in on their local machines?

julescarbon commented 12 years ago

domain=." + BROWSER + "; should the leading period be there if you're hitting it from localhost?

On Tue, Apr 17, 2012 at 6:18 PM, Steve Geluso < reply@reply.github.com

wrote:

I can run the server and the client on my local machine. However, I have trouble logging in. It seems that things are not actually being added to my cookies.

Lines 272-273 in the lobby seem to try to write the session to the cookie, yet when I print the cookie to the console immediately after, I do not see the session within it. After logging in, I'm redirected to the bigapple room and prompted to log in again.

''' document.cookie = "session="+Auth.session+";path=/;domain=." + BROWSER + ";max-age=1086400"; console.log(document.cookie); '''

Anyone else having this trouble logging in on their local machines?


Reply to this email directly or view it on GitHub: https://github.com/frdrck/Pomme/issues/10

geluso commented 12 years ago

Yeah, you're right. There's something wrong with the periods when using localhost. It seems that localhost behaves oddly because it isn't exactly a proper domain.

When I remove the domain attribute the cookie persists without any problems.

Stack Overflow conversation suggests omitting the domain when working with localhost, or creating some virtual hosts within apache to create a domain on our local machines.

http://stackoverflow.com/questions/1134290/cookies-on-localhost-with-explicit-domain