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

Include cookie expiration and ttl in the identity example #473

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

jwiesler
Copy link
Contributor

@jwiesler jwiesler commented Oct 2, 2024

PR Type

Other/Improve examples

PR Checklist

  • Tests for the changes have been added / updated. (does not apply
  • Documentation comments have been added / updated.
  • A changelog entry has been made for the appropriate packages.
  • Format code with the nightly rustfmt (cargo +nightly fmt).

Overview

I ran into this issue that on some mobile browsers not setting a ttl of the session cookie will actually delete the cookie on session end (some time when the app goes into sleep mode).
I noticed this issue for almost two years now but could never figure out why it was happening. It is very hard to diagnose since it is sporadic and only happens on some browsers (here it was Brave).

I think it's very helpful to include session_ttl in the example, I guess many usages of the identity middleware are to enable login flows with some kind of expiration and I just did not know about this at all.

This only changes the example of actix-identity, I ran it locally and it works as expected.

@robjtede robjtede added A-identity Project: actix-identity B-semver-norelease marks that code change does not require a release labels Oct 7, 2024
Copy link
Member

@robjtede robjtede left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice tweak, thanks 👍🏻

@robjtede robjtede added this pull request to the merge queue Oct 7, 2024
Merged via the queue into actix:master with commit 21680e0 Oct 7, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-identity Project: actix-identity B-semver-norelease marks that code change does not require a release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants