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
Fix: Session middleware issues #1407
Conversation
Fix: Session.Regenerate does not set Session.fresh to be true.
Thanks for opening this pull request! 🎉 Please check out our contributing guidelines. If you need help or want to chat with us, join us on Discord https://gofiber.io/discord |
Thx Since these bugs were not found by the tests, can you please add some to ensure that future code changes do not cause this problem again? |
Hey, thanks for the PR! Some comments:
I was working on a similar problem a few days ago, where |
It’s true that we need to set session for user after I agree that you should set I am curious which is a more appropriate definition of regenerate ID, here are two versions:
For version 1, the new session do not have any data. So the session is fresh. Both of these two versions requires fiber to set session for user. According to the main branch of fiber, the If you think that version 2 is the more appropriate implementation, then we should set |
My mistake. I looked at the |
Congrats on merging your first pull request! 🎉 We here at Fiber are proud of you! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord |
Fix: Session.Regenerate does not set Session.fresh to be true.
Fix: Session should be regenerated if the session can not be found in the storage.
This PR is intended to close #1395 issue and #1408 issue.
Tests have been added.
Some old tests have been modified.
If there are some questions, I will answer them.