Insecure Session Management (Excessive Cookie Lifetime)
- CWE 613
- OWASP 2025-A07
A session cookie is persistent and stays in the browser for a very long time, more than thirty days. A persistent session credential on a shared or stolen device, or in a backup of the browser profile, can be used for as long as the cookie remains valid on the server.
Remediation
Use session cookies (no
Expiresand noMax-Age) for authentication, so that they disappear when the browser is closed.Limit the server side lifetime of the session and enforce an idle timeout and an absolute timeout.
Treat "remember me" separately with a dedicated token that is stored hashed on the server, is rotated on use and gives less privilege than a normal login.
References
Go Back to List
Search Vulnerability
You may also see
- Insecure Session Management (Missing SameSite Attribute)
- Insecure Session Management (SameSite None Without Secure)
- Insecure Session Management (Weak Session Identifier)
- Insecure Session Management (Predictable Session Identifier)
- Insecure Session Management (Session Identifier in URL)
- Insecure Session Management (Excessive Cookie Lifetime)
- Insecure JSON Web Token
- Insecure Session Management