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

Persist metadata to session #53

Open
notramo opened this issue May 7, 2023 · 5 comments
Open

Persist metadata to session #53

notramo opened this issue May 7, 2023 · 5 comments

Comments

@notramo
Copy link

notramo commented May 7, 2023

Is it possible to persist metadata to session?

@akadusei
Copy link
Contributor

akadusei commented May 7, 2023

Depends on the nature of this metadata. Lucky::Session#set takes in only String values. If this metadata is a compound data type, you could #to_json it and set it in session, then .from_json it when you retrieve it (assuming it's JSON-serializable).

@notramo
Copy link
Author

notramo commented May 8, 2023

Where is it stored? It's important to document it, because developers need to know if it's sent to the client or stored server-side. If it's sent to the client, is it encrypted?

@akadusei
Copy link
Contributor

akadusei commented May 8, 2023

Lucky encrypts sessions server side, then stores them as cookies on the client (via the Set-Cookie response header). You may check Lucky's documentation at https://luckyframework.org, or view the source code at https://github.com/luckyframework/lucky.

@notramo
Copy link
Author

notramo commented May 8, 2023

Is it possible to add a server-side storage for sessions which are not sent to clients?

I'm also interested in what data does shield store, and where?

@akadusei
Copy link
Contributor

akadusei commented May 9, 2023

Is it possible to add a server-side storage for sessions which are not sent to clients?

Check out https://github.com/KasKatto/redis-session. Shield will use whatever session handler your Lucky app uses. You may also ask for more suggestions/recommendations in the Lucky forums (https://github.com/luckyframework/lucky/discussions), or on discord (https://luckyframework.org/chat).

I'm also interested in what data does shield store, and where?

See #54 (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

2 participants