Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue when using "localhost" #1

Closed
troublete opened this issue Jul 3, 2016 · 7 comments
Closed

issue when using "localhost" #1

troublete opened this issue Jul 3, 2016 · 7 comments
Labels

Comments

@troublete
Copy link

I had a tiny issue when using localhost as domain.

It seemed like the parameters couldn't be pushed into a cookie. I just quickly debugged it in the "login" method. Maybe some further investigation will be necessary.

Just wanted to let u know.

I used it with a ordinary XAMPP stack with PHP 7 - just to make this information useful.

Great lib btw! 👍

@ocram ocram added the question label Jul 7, 2016
@ocram
Copy link
Contributor

ocram commented Jul 7, 2016

Thanks a lot for your report!

Unfortunately, no problems here on XAMPP with PHP 7.0.8, so cannot reproduce. Sorry!

Could you please describe what has been your issue with cookies on localhost?

What's wrong specifically? Are you unable to sign in? Can you try the sample application from the tests directory and see if things work there?

Thank you!

@ocram ocram changed the title [bug] issue when using "localhost" issue when using "localhost" Jul 7, 2016
@troublete
Copy link
Author

Well i actually didn't investigate much further after it worked on 127.0.0.1 -- will try when i have a minute tho to give a more precise picture.

The case looked like that, and i thought it was kinda odd, i build a "simple" signup thing where i allowed to directly verify after signup because was just for a small project where mail server wasn't necessary. And after the signup the login did "happen" - in the sense that the check immediatly after the login worked (literaly next line) -- when i redirected tho to a dashboard page the cookie wasn't set. i thought it was weird. when i checked the cookie set -- and either domain or path was set that localhost was set like ".localhost" -- where i think that after the redirect the cookie didn't apply for the page. as i said i'll look into it again.

@ocram
Copy link
Contributor

ocram commented Jul 7, 2016

Ah, that makes sense! Thank you!

So things were not really working on localhost but as soon as you switched to its equivalent 127.0.0.1, everything was working without any changes, right?

I'm using Firefox, and .localhost works fine as the cookie domain. Maybe you're using some other browser where this does not work?

Looked up Chrome's behavior, and found two issues in Chrome's bug tracker:

From what I understood, cookies might work in Chrome if you're setting the domain to localhost (without the leading dot) or to an empty string. We should check that. Most importantly, we should not implement a browser switch but find one solution that works for all browsers.

In the meantime, using 127.0.0.1 is probably a good workaround. Thanks!

@troublete
Copy link
Author

Affirmative.
I use Chrome, gimme that v8! 😄
No problem. Thank u for the quick response! :)
I may create a pull request, but no time atm. sorry.

@ocram ocram added bug and removed question labels Jul 8, 2016
@ocram
Copy link
Contributor

ocram commented Jul 8, 2016

Thank you so much!

Especially your observations from the second comment were really helpful.

This should have been fixed now :) Can you try? You just need to update your dependency via composer update since v2.0.1 contains the fix.

@troublete
Copy link
Author

Just tried. Lookin swell! :) Good job! 👍

@ocram
Copy link
Contributor

ocram commented Jul 11, 2016

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants