Session Management
Verify JWT token-based session management including token refresh and logout functionality. Tests the complete session lifecycle.
Preconditions
- You have valid login credentials for an existing account
- You are not currently logged in
Test Data
Use credentials from a verified account.Test Steps
Follow each step carefully
Login with valid credentials
Complete the login flow (auth-2)
Login succeeds and JWT tokens are returned
Both access token and refresh token should be stored
Verify tokens are stored (check browser dev tools)
Open browser dev tools > Application > Local Storage or Cookies
Access token and refresh token are present
Tokens may be in localStorage, sessionStorage, or HTTP-only cookies
Access a protected route or API endpoint
Navigate to dashboard or any authenticated page
Protected content is accessible
Wait for access token to expire or manually trigger refresh
Access tokens typically expire in 5-15 minutes
Application automatically refreshes token using refresh token
Verify the refresh happens transparently without user interaction
Verify you can still access protected routes after token refresh
Continue using the application normally
Application continues to work without requiring re-login
Click the logout button
Usually in user menu or navigation
Logout confirmation or redirect to login page
Verify tokens are invalidated after logout
Check browser dev tools again
Tokens are removed from storage
Attempt to access a protected route after logout
Try to navigate directly to a dashboard URL
User is redirected to login page or access is denied
Expected Result
Session management works correctly: (1) Login returns both access and refresh tokens, (2) Access token is used for API authentication, (3) Refresh token successfully obtains new access token when needed, (4) Logout invalidates all tokens, (5) Protected routes are inaccessible after logout, (6) Attempting to use old tokens fails.
Ready to Complete?
Click when you have verified all steps and the expected result.
Test Info
- Module
- Authentication
- Steps
- 8
- Duration
- 4 min
- XP Value
- +30