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

[5.x] Fix session expiry component #11501

Merged
merged 1 commit into from
Feb 25, 2025
Merged

[5.x] Fix session expiry component #11501

merged 1 commit into from
Feb 25, 2025

Conversation

jasonvarga
Copy link
Member

@jasonvarga jasonvarga commented Feb 25, 2025

tldr: This PR brings back the expected (carbon 2) behavior. It provides the remaining session seconds as a positive integer which prevents the session expiry modal appearing when not necessary.

CleanShot 2025-02-25 at 11 34 27


The session expiry component exists on every control panel panel. It receives the session lifetime in sections and will begin a countdown. When it gets to about a minute, it will perform an ajax request to a route that will give the real remaining time left in the session.

If another tab was using the site in the mean time, the session would have been extended. The ajax request should reflect it.

Carbon 3 will return "diffInSeconds" as a negative number for times in the future. Since the component now receives a
negative number, it will show the "your session has expired" modal and ask you to log back in, even if it's not necessary.

This issue was only noticeable if you left a tab open for longer than the session lifetime, and were on the latest Statamic version that uses Carbon 3.

@jasonvarga jasonvarga merged commit 600ecc5 into 5.x Feb 25, 2025
20 checks passed
@jasonvarga jasonvarga deleted the session-timeout branch February 25, 2025 16:38
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.

1 participant