Session Duration
Control how long the signed switch cookie remains valid after a session is started.
Navigate to SwitchGuard → Settings → Access Control → Session Duration.
Settings
| Setting | Default | Range | Description |
|---|---|---|---|
| Session Duration | 48 hours | 1–168 hours (up to 7 days) | How long the switchguard_origin cookie stays valid |
How It Works
When you start a switch session, SwitchGuard writes a signed switchguard_origin cookie that holds your original identity. The cookie expiry is set to the configured number of hours at the moment the switch is initiated.
- Browsing activity does not extend the expiry — the clock starts when you switch, not when you last loaded a page.
- If the cookie expires before you switch back, your origin identity is forgotten and you will need to log in to your admin account manually.
48 hours (the default) is a safe balance for routine support tasks. For high-security environments consider reducing this to 1–8 hours so stale sessions expire quickly.
If the session expires while you are browsing as another user, you will be logged in as that user with no automatic switch-back. Log in to your administrator account normally to regain access.
Relationship with Idle Timeout (Pro)
Session Duration and Idle Timeout are complementary controls, not duplicates:
| Control | Trigger | Effect |
|---|---|---|
| Session Duration | Time elapsed since switch | Cookie expires — origin is forgotten |
| Idle Timeout (Pro only) | No page activity for X minutes | Automatic switch-back to original account |
Both can be active at the same time. A 48-hour session duration with a 30-minute idle timeout means the session auto-switches back on inactivity, but the cookie also hard-expires after 48 hours regardless.
See Idle Timeout for the Pro idle timeout setting.