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

Custom Session Storage implementation and data #2

Open
sergiodxa opened this issue Jun 21, 2024 · 1 comment
Open

Custom Session Storage implementation and data #2

sergiodxa opened this issue Jun 21, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@sergiodxa
Copy link

Right now the Session Storage instance is created here

const { getSession, commitSession, destroySession } =
createCookieSessionStorage({
cookie: {
name: cookieName,
...cookieOptions,
},
});

And it's always using createCookieSessionStorage.

What happens if I want to use a different session storage? E.g. on Cloudflare I may want to use createWorkerKVSessionStorage, on Arc I could use createArcTableSessionStorage, and while createMemorySessionStorage and createFileSessionStorage are probably not recommended they're options and the memory one is specially useful on test environments.

I could also want to use createSessionStorage to create a new session storage where the session data is saved on the DB or Redis or anywhere else.

Additionally, I may want to use the session to store more data that my app needs, right now I can't import the session storage to access it myself.

I think the library should expect a SessionStorage compatible object and use that internally, giving me control of what session storage I choose to use and how I use it.

@PaulAsjes
Copy link
Collaborator

This (and the other issues you opened) is great feedback, thanks! We're going to action all of these in the next few weeks.

@PaulAsjes PaulAsjes added the enhancement New feature or request label Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants