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

Fixed Double login when switching users #11790

Merged

Conversation

inietov
Copy link
Collaborator

@inietov inietov commented Sep 6, 2022

Description

When changing users (logout with user Foo, then login back with another user Bar), the system appear to not doing anything and re-show the Log In form, no error, no message displayed.

It happens because the previous logged in user's hash is saved in a session value, so when switching users the hash is different as the one trying to log in, so the system logs out us without warning. Second time the session value doesn't exists anymore so it let us log in normally.

To fix this I remove that value (password_hash_web) from the session and now it works as intended. Maybe is worth to think about removing all session values on logout? since I don't think it's necessary to save any session value once we log out?

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Test Configuration:

  • PHP version: 7.4.16
  • MySQL version: 8.0.23
  • Webserver version: nginx/1.19.8
  • OS version: Debian 10

Checklist:

@snipe
Copy link
Owner

snipe commented Sep 7, 2022

This looks great, Ivan - thank you!

@snipe snipe merged commit 659703b into snipe:develop Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants