17 lines
999 B
Markdown
17 lines
999 B
Markdown
# 0042 A session that ends mid-use keeps the visitor's drafts
|
|
|
|
Status: Proposed · Area: architecture · Date: 2026-10-09 · Decided by: agent
|
|
|
|
## Context
|
|
G-4f: when the browser's refresh fails while a member uses a guarded page, the board shows «نشست شما به پایان رسید» with «ورود دوباره» and says nothing typed is lost. The shell used to clear post and checkout drafts on any logout.
|
|
|
|
## Decision
|
|
- On a failed refresh mid-use, `AuthGuard` shows the session-ended state; «ورود دوباره» goes to login with `?redirect=` back to the page. A session already dead at page load still redirects to login.
|
|
- Drafts and `session.*` storage are cleared only on an explicit sign-out, never when the reason is `session-ended`.
|
|
|
|
## Alternatives
|
|
- Redirect silently and clear drafts: loses what the person typed.
|
|
|
|
## Consequences
|
|
A different person signing in on the same device may see the previous person's draft; the drafts carry no personal data beyond post text.
|