Skip to content

Keep a panel sign-in for 12 hours instead of a year - #1111

Merged
KrzysztofPajak merged 2 commits into
developfrom
fix/panel-cookie-lifetime
Nov 23, 2026
Merged

KrzysztofPajak merged 2 commits into
developfrom
fix/panel-cookie-lifetime

Conversation

@KrzysztofPajak

@KrzysztofPajak KrzysztofPajak commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

The admin, store and vendor panels shipped Security:CookieAuthExpires = 8760 (hours) in their appsettings.json, so a staff sign-in cookie stayed valid for a year, also after the browser had been left alone. A stolen panel cookie stayed usable for as long.

Changes

  • Grand.Web.Admin, Grand.Web.Store, Grand.Web.Vendor App_Data/appsettings.json: CookieAuthExpires is 12, with the comment updated.

Notes

  • CookieAuthenticationService.SignIn sets AuthenticationProperties.ExpiresUtc, which the cookie handler treats as an absolute expiry: a panel sign-in ends 12 hours after it was made, also while the panel is in use, and staff sign in again.
  • The storefront keeps 8760 hours.
  • Installations that keep their own appsettings.json keep their current value; Security__CookieAuthExpires overrides it.

Tests

  • Configuration only.

The admin, store and vendor panels shipped CookieAuthExpires = 8760, so a staff sign-in cookie stayed valid for a year, also after the browser had been left alone.

The three panels now ship 12 hours. The cookie is renewed for the same span while the panel is used, so an active session goes on and an idle one ends. The storefront keeps its year.
Copilot AI balanced review requested due to automatic review settings November 23, 2026 06:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

The sign-in sets ExpiresUtc, which the cookie handler treats as an absolute expiry and does not renew, so the comment no longer says the session is renewed while in use.
@KrzysztofPajak
KrzysztofPajak merged commit f0c0fd3 into develop Nov 23, 2026
9 checks passed
@KrzysztofPajak
KrzysztofPajak deleted the fix/panel-cookie-lifetime branch November 23, 2026 17:07
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.

2 participants