Session stores in SolidStart
How to use different session stores in SolidStart? What is the default store?
https://docs.solidjs.com/solid-start/advanced/session
1 Reply
If I understand your question the API simply wraps server side cookie interactions (preferably
HttpOnly
).
So typically you would just keep a session ID inside the cookie that lets you retrieve the client specific data from a server side store of your choice.
A good place to start is unstorage which is used in the with-auth
example.Handle Session - h3
Remember your users using a session.
MDN Web Docs
Using HTTP cookies - HTTP | MDN
A cookie (also known as a web cookie or browser cookie) is a small piece of data a server sends to a user's web browser. The browser may store cookies, create new cookies, modify existing ones, and send them back to the same server with later requests. Cookies enable web applications to store limited amounts of data and remember state informatio...
unstorage - Universal Key-Value.
Unified key-value storage API with conventional features and 20+ built-in drivers.
GitHub
solid-start/examples/with-auth/src/lib/db.ts at 678d9acbc0bb669f879...
SolidStart, the Solid app framework. Contribute to solidjs/solid-start development by creating an account on GitHub.
MDN Web Docs
Set-Cookie - HTTP | MDN
The Set-Cookie HTTP response header is used to send a cookie from the server to the user agent, so that the user agent can send it back to the server later.
To send multiple cookies, multiple Set-Cookie headers should be sent in the same response.