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

How to set different MaxAge for cookie and store(redis) #204

Open
shinolex opened this issue Oct 27, 2022 · 0 comments
Open

How to set different MaxAge for cookie and store(redis) #204

shinolex opened this issue Oct 27, 2022 · 0 comments

Comments

@shinolex
Copy link

Hello,

I want to set MaxAge to 0 for expiration time in browser side but I want to give another MaxAge for my redis store. Is it possible to do it? So far I've tried this store.Options(sessions.Options{MaxAge: 0}) before I make r.Use call as mention here

When I set MaxAge to 0 it works on browser side, it creates the cookie with expiration time "session" but the session info does not get stored in Redis.

My goal here is, force the user to login everytime he enters the website for the first time and keep the session open as long as he don't close the browser. Once he closes it the old session will be dropped from browser and from redis after 10 days.

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