← ClaudeAtlas

session-management-test-authorlisted

Use for any question or task about testing sessions, login or logout security in a web app, in any framework, including one login handler and old cookies that still work after logout: cookie flags (Secure, HttpOnly, SameSite), session ID regeneration on login, idle and absolute timeouts, concurrent-session limits, logout on all devices, CSRF tokens and session binding, per OWASP ASVS V3.
testland/qa · ★ 13 · Testing & QA · score 80
Install: claude install-skill testland/qa
# session-management-test-author ## Overview This build-an-X workflow authors tests for the session layer against [OWASP ASVS V3 (Session Management)][asvs]: cookie attributes, timeout behavior, session-ID regeneration, and logout semantics. Cite requirements in the versioned form `v<version>-<chapter>.<section>.<requirement>` (e.g., `v5.0.0-1.2.5`) so assertions stay stable across releases. [asvs]: https://owasp.org/www-project-application-security-verification-standard/ ## When to use - Authoring tests for any web app with sessions (cookie-based or token-based). - Reviewing PRs that touch login / logout / session middleware. - A security audit cites ASVS V3 as a target. - Compliance program (SOC 2, ISO 27001) requires evidence of session-management testing. ## Step 1 - Cookie attribute baseline Every session cookie MUST set: | Attribute | Required value | Why | |---|---|---| | `Secure` | true (in production) | Prevents transmission over plaintext HTTP | | `HttpOnly` | true | Prevents JavaScript access (XSS impact reduction) | | `SameSite` | `Strict` or `Lax` | CSRF defense | | `Path` | scope to app root or narrower | Limits cookie exposure | | `Domain` | NOT a parent domain (avoid subdomain leak) | Limits cookie exposure | | `Max-Age` or `Expires` | finite (absolute timeout) | Session can't outlive intended lifetime | **Test pattern (Python with requests):** ```python def test_session_cookie_has_all_required_attributes(client, base_url): response = client.