Skip to content

Commit

Permalink
update session cookie age
Browse files Browse the repository at this point in the history
  • Loading branch information
jtimpe committed Jun 2, 2024
1 parent 91bef41 commit 0e3026d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tdrs-backend/docs/session-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ When the user logs in, they will receive an HttpOnly cookie with no `Expires=` s
SESSION_EXPIRE_AT_BROWSER_CLOSE=True
```

The cookie itself contains a `sessionid` reference to a Django-managed session. The session expiration is set to the ~~same expiration of the login.gov-provided jwt~~, **30 minutes**.
The cookie itself contains a `sessionid` reference to a Django-managed session. The session expiration is set to the same expiration of the login.gov-provided jwt, **15 minutes**.

This is managed in `tdrs-backend/tdpservice/settings/common.py` with the following setting:
```python
SESSION_COOKIE_AGE = 30 * 60 # 30 minutes
SESSION_COOKIE_AGE = 15 * 60 # 30 minutes
```

### Frontend
Expand Down
2 changes: 1 addition & 1 deletion tdrs-backend/tdpservice/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ class Common(Configuration):
SESSION_ENGINE = "django.contrib.sessions.backends.signed_cookies"
SESSION_COOKIE_HTTPONLY = True
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
SESSION_COOKIE_AGE = 30 * 60 # 30 minutes
SESSION_COOKIE_AGE = 15 * 60 # 15 minutes
# The CSRF token Cookie holds no security benefits when confined to HttpOnly.
# Setting this to false to allow the frontend to include it in the header
# of API POST calls to prevent false negative authorization errors.
Expand Down

0 comments on commit 0e3026d

Please sign in to comment.