PlexichatGuides
Security Logout
Guides, route-group overviews, and live schema entry points for the Plexichat backend.
Security logout
You have been signed out of one or more sessions. Plexichat revokes the session token and clears the browser cookie.
This page explains why it happened and what to do next. API details are in src/api/routes/auth/sessions.py and src/core/auth/managers/session.py.
Why you were signed out
- You signed out.
POST /api/v1/auth/logoutrevokes your current session (revoked = 1) and clears theHttpOnlysession cookie. - You or an administrator revoked sessions.
DELETE /api/v1/auth/sessions/{session_id}revokes a single session.POST /api/v1/auth/sessions/revoke-allrevokes all sessions or all except the current one ({"except_current": true}). - Your session expired. Sessions expire after
authentication.sessions.expire_hours(default 168 hours / 7 days). Sessions on a device you explicitly marked trusted use the longerauthentication.sessions.trusted_expire_hours(default 720 hours / 30 days) instead. Expired tokens returnTokenExpiredError. - Your session was rotated or invalidated.
POST /api/v1/auth/refreshrotates the token. The old token is invalid after rotation. Revoking a session invalidates cached verification (token_verify:*). - Administrator or security action. Disabling TOTP 2FA revokes all other sessions. An administrator can also freeze an account scheduled for deletion.
What to do next
- Sign in again with your username and password. If you use 2FA or passkeys, complete that step.
- Review active sessions:
GET /api/v1/auth/sessionsreturnsid,ip_address,user_agent,created_at,expires_at,last_activity, andcurrent. - If you see a session you do not recognize, revoke it or use
POST /api/v1/auth/sessions/revoke-all.
If you believe the sign-out was a mistake, contact your server administrator.
Session behavior to know
- Maximum sessions:
authentication.sessions.max_per_user(default 10). When you exceed the limit, the oldest sessions are revoked. - Activity extension: If
authentication.sessions.extend_on_activityistrue(default),last_activityupdates after 60 seconds of inactivity andexpires_atextends when you are withinextend_threshold_hours(default 24 hours) of expiry. Setextend_threshold_hoursto0to extend on every activity. - Cookies and CSRF: Browser sessions use an
HttpOnlycookie. Refresh via cookie requires theX-Plexichat-Request: 1header to prevent CSRF. - Trusted devices (2FA skip). A device fingerprint you explicitly marked trusted via
POST /api/v1/auth/devices/trustcan sign in without re-entering a TOTP code. Trust is stored server-side on the device row, never in any client-controlled value, and a missing or unknown fingerprint can never match. Revoke trust any time withPOST /api/v1/auth/devices/untrust; revoking the device also removes its 2FA skip.
For administrators
- To sign out a single user from all devices, call
logout_all(user_id)orPOST /api/v1/auth/sessions/revoke-allas that user. - To sign out all users, the server can call
logout_all_users().
Get help
- Try signing in again and check your password and 2FA code.
- Review your sessions and revoke unknown ones.
- Contact your server administrator if you cannot sign in or suspect unauthorized access.