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

User sessions #7

Open
lpil opened this issue Aug 6, 2023 · 3 comments
Open

User sessions #7

lpil opened this issue Aug 6, 2023 · 3 comments
Labels
later This is an issue to tackle later after other issues

Comments

@lpil
Copy link
Collaborator

lpil commented Aug 6, 2023

Sessions! Another common feature of web frameworks.

What do we want to provide here?

Depends on being able to write signed cookies: #5

@lpil lpil added the later This is an issue to tackle later after other issues label Aug 6, 2023
@pedraal
Copy link

pedraal commented Aug 7, 2024

I've been working on a package to handle user session in my apps, it is not pushed to hex at the moment because I don't want to name squat something that would look official while its not 😅 maybe I could convert it into a PR for wisp if it looks good enough to you. Or I'll just rename it, as you prefer 😄 https://github.com/pedraal/wisp_session

@lpil
Copy link
Collaborator Author

lpil commented Aug 14, 2024

Cool, thank you. I'm currently not entirely sure how opinionated to be here. Does it make sense to always use JSON when there's more compact options folks could use? What about customising the cookie name? Some security requirements would mandate it being obscure. What about customising the cookie options? Lots of things I'm unsure how to approach here.

aside: In Gleam we never use Option for success and failure, so read_session should return a Result

@pedraal
Copy link

pedraal commented Aug 14, 2024

Sorry I'm not sure to understand if your question about JSON format is a suggestion or something unclear in my implementation. But in my repo the session format is up to the user, the cookie value could be just a string pointing to some record in a database. In that case the decoder could be in charge of fetching the data and the encoder to generate the string. I don't think we should enforce a session format.
Edit : oh I see, I forgot that the repo readme is showcasing only JSON session, I'll make it clearer that it can be used with any data structure !

For the cookie name and options, I can do that 🙂 And understood for the Option / Result, thank you !

Would you accept if I move this into a PR or you prefer to keep it on the side for now as you are still thinking of the design ? In that case I'll find another name to avoid confusion with official stuff

Edit: I've renamed it anyway 😄 I'm bad at naming things but here it is https://github.com/pedraal/sessy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
later This is an issue to tackle later after other issues
Projects
None yet
Development

No branches or pull requests

2 participants