Skill 5.2.3
Session management
Key Concepts
After authentication, a session token represents the user. Tokens must be random, transmitted only over encrypted connections, protected in cookies with Secure, HttpOnly and SameSite attributes, regenerated after login to prevent session fixation and invalidated at logout.
Idle and absolute timeouts limit the window for hijacking, and re-authentication is required for sensitive actions. Concurrent session limits and anomaly detection, such as a sudden location change, detect stolen sessions.