Switch Cookie & Session
What Happens During a Switch
- SwitchUser stores your original account ID (and who started the switch) in a signed cookie named
switchuser_origin. - The cookie is signed with HMAC-SHA256 using your site's WordPress auth salt (
wp_salt( 'auth' )). - The cookie expires after the Session Duration (default 48 hours, 1–168 hours).
- You're logged in as the target user with a normal WordPress login cookie.
Cookie Properties
| Property | Value |
|---|---|
| Name | switchuser_origin |
| HTTP-only | Yes |
| SameSite | Lax |
| Expiry | Session Duration - 1 to 168 hours (default 48) |
| Signature | HMAC-SHA256 with the WordPress auth salt |
- The signature stops anyone from editing the cookie to switch back into a different account.
- The cookie holds user IDs, not passwords or login credentials.