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

sqlite3 store with custom table name #209

Open
W1M0R opened this issue May 13, 2024 · 0 comments
Open

sqlite3 store with custom table name #209

W1M0R opened this issue May 13, 2024 · 0 comments

Comments

@W1M0R
Copy link

W1M0R commented May 13, 2024

Currently, sqlite3store requires an sqlite table named "sessions", as per the documentation and source code here:

  1. https://github.com/alexedwards/scs/blob/master/sqlite3store/README.md
  2. https://github.com/alexedwards/scs/blob/master/sqlite3store/sqlite3store.go

Imagine a scenario where I want to use two session managers, as described here (https://github.com/alexedwards/scs?tab=readme-ov-file#multiple-sessions-per-request), each with their own separate sqlite3 stores and cookie settings. I'm not sure what would happen if both session managers use the same "sessions" sqlite3 table, but I'm guessing everything will actually work as expected, that is, all tokens will expire at the right time (according to their session manager options) and there won't be any strange side-effects.

Ideally though, I'd like to be able to specify the table used by the stores, e.g. "sessions_auth", and "sessions_opts". In that way, I could provide tables that match my schema naming conventions. I'm not sure if there are other good reasons for wanting to specify the table name.

If I want to enumerate (or clear/delete) all the sessions managed by manager 1, but keep the sessions of manager 2 unchanged, would this be possible with the current shared "sessions" table?

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