Skip to content

Automatic renewal for sessions #281

@canidam

Description

@canidam

Is there an existing feature request for this?

  • I have searched the existing feature requests

Is your feature request related to a problem? Please describe.

I've a web app protected by a login system. Clients log in, and I keep their status / identity in a session cookie.

Today the maxAge is set to 30 days by default, allowing the user to update CookieStore with MaxAge method.
This means users will have to re-login a system after 30 days, even if they browse the site daily.

Describe the solution that you would like.

Add a "automatic cookie renewal" functionality to allow the library renew cookies that are about to expire.

For example, a cookie is created with max age of 30 days. If the server sees a cookie that is about to expire in ~3-4 days, it renews itself by simply copying the session data to a new cookie with an updated maxAge of 30 days.

In scenarios where a user is not active for 30 days, and the cookie expires, they will need to re-login the system.

Describe alternatives you have considered.

Implementing this login in a middleware, but it is easier to do in the store itself.

Anything else?

No response

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