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

Add an option to enable cookie refreshing #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jaloisi834
Copy link

Summary

Adds a new option to allow refreshing of existing session cookies (off by default).

Currently, when the MaxAge option is provided, the value of the TTL field in the DynamoDB store will be updated on each save, however the cookie will not. Even if the value of the TTL field in the DynamoDB store is extended, the cookie will still expire at the original MaxAge.

This change allows for the associated session cookie's TTL to be updated similarly by letting it be recreated.

Changes

  • New refreshCookies (bool) field on Store
  • New RefreshCookies() Option that when provided sets Store.refreshCookies to true
  • Changed logic determining if the session cookie can be set on save
    • Before: If session is not new, do nothing ; otherwise create and set cookie
    • After: If session is new or if Store.refreshCookies is true, create and set the cookie ; otherwise do nothing

@pm98zz-c
Copy link

That's exactly what I was after. I know the PR is old as hell, but that looks fine as is, would be good to get it merged.

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

Successfully merging this pull request may close these issues.

None yet

2 participants