Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PADV-729 - Support user session timeout #105

Open
wants to merge 1 commit into
base: pearson-release/olive.stage
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3718,6 +3718,13 @@ def _make_locale_paths(settings): # pylint: disable=missing-function-docstring
FILE_UPLOAD_STORAGE_BUCKET_NAME = 'SET-ME-PLEASE (ex. bucket-name)'
FILE_UPLOAD_STORAGE_PREFIX = 'submissions_attachments'

##### SESSION EXPIRATION TIME #####
# .. setting_name: SESSION_EXPIRY_SECONDS
# .. setting_default: 604800 * 4
# .. setting_description: Specifies the expiration duration for session users.
SESSION_EXPIRY_SECONDS = 604800 * 4


##### ACCOUNT LOCKOUT DEFAULT PARAMETERS #####
# .. setting_name: MAX_FAILED_LOGIN_ATTEMPTS_ALLOWED
# .. setting_default: 6
Expand Down
6 changes: 4 additions & 2 deletions openedx/core/djangoapps/user_authn/views/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,10 @@ def _handle_successful_authentication_and_login(user, request):

try:
django_login(request, user)
request.session.set_expiry(604800 * 4)
log.debug("Setting user session expiry to 4 weeks")

seconds_to_expire = settings.SESSION_EXPIRY_SECONDS
request.session.set_expiry(seconds_to_expire)
log.debug("Setting user session expiry to {} seconds".format(seconds_to_expire))

# .. event_implemented_name: SESSION_LOGIN_COMPLETED
SESSION_LOGIN_COMPLETED.send_event(
Expand Down
Loading