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

Storage Adapter UPSERT Behavior #3148

Open
sixcolors opened this issue Sep 25, 2024 · 0 comments
Open

Storage Adapter UPSERT Behavior #3148

sixcolors opened this issue Sep 25, 2024 · 0 comments

Comments

@sixcolors
Copy link
Member

Known Issue

Storage Adapter UPSERT Behavior

There is an issue with the way Fiber's storage adapters handle setting keys. The current operation for setting a key is an UPSERT, which means it will insert a new key if it does not exist or update it if it does. This can lead to issues in scenarios with simultaneous requests altering the same session. For example:

  • One request destroys the session.
  • Another request makes an inconsequential change to the session.

If the session destruction completes first, the inconsequential change could recreate the session, potentially preventing actions like logging out and posing security risks.

Since PR #3016 changes the session behavior to save and update on every request, it amplifies the problem if not addressed.

Originally posted by @sixcolors in #3016 (comment)

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

No branches or pull requests

1 participant