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

Impact on remember_token? #11

Closed
drbyte opened this issue Mar 30, 2017 · 6 comments
Closed

Impact on remember_token? #11

drbyte opened this issue Mar 30, 2017 · 6 comments
Labels

Comments

@drbyte
Copy link
Contributor

drbyte commented Mar 30, 2017

I've been using this package happily on a project, except that users are all complaining that their "remember me" stopped working.

My usual suspect was broken cookies, or bad remember_tokens in the user table, so I cleared all those, but the problem persists. The only other change was adding this package.

Wondering if you've seen any evidence of this same symptom, or have any ideas why it would be interfering?

Just using the default file session driver. All /config/session.php is same as standard Laravel 5.4 release defaults.

@MarceauKa
Copy link
Member

Hi, than you for your issue. I'm looking to it.

@MarceauKa MarceauKa added the bug label Mar 30, 2017
@MarceauKa
Copy link
Member

Confirmed. When you leave impersonation of an user the remember_token is updated.

@MarceauKa
Copy link
Member

This is due to the logout() method that's calling the method cycleRememberToken().

Two scenarios to fix that:

  1. Save the impersonated user remember_token before taking impersonation and restoring it when leaving.

  2. Creating an extension to the SessionGuard with a custom implementation of login() and logout().

In both case, I'll need an update because I don't want login and logout events to be fired.

@drbyte
Copy link
Contributor Author

drbyte commented Apr 1, 2017

Will swapping remember_tokens prevent the actual user from logging in whilst already being impersonated on another computer?

@MarceauKa
Copy link
Member

Fixed. See c76bb96

@drbyte
Copy link
Contributor Author

drbyte commented Apr 5, 2017

Thanks! Will upgrade and try it out!

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

No branches or pull requests

2 participants