Skip to content

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

@shinolex

Description

@shinolex

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions