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

CookieStorage: reading from state after modifying it returns previous state #67

Closed
dakur opened this issue Sep 30, 2022 · 3 comments
Closed

Comments

@dakur
Copy link
Contributor

dakur commented Sep 30, 2022

Version: 3.1.5

Bug Description

State change is not propagated.

Steps To Reproduce

security:
    authentication:
        storage: cookie
$this->userStorage->saveAuthentication(new SimpleIdentity('abc'));
[$isAuthenticated, $identity] = $this->userStorage->getState();

Expected Behavior

  • $isAuthenticated should be true, but is false
  • $identity should be SimpleIdentity('abc'), but is null

Possible Solution

Cache identity in saveAuthentication() and return it in getState() before touching request cookie.

@dakur
Copy link
Contributor Author

dakur commented Sep 30, 2022

I've made PR #68

@dakur
Copy link
Contributor Author

dakur commented Oct 12, 2022

@dg Could you tag the fix, please?

@dakur
Copy link
Contributor Author

dakur commented Oct 13, 2022

Thank you!

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

Successfully merging a pull request may close this issue.

1 participant