1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 06:51:10 +03:00

set the session cookie expiry *properly* on each request

see: https://github.com/ansible/tower/issues/2907
This commit is contained in:
Ryan Petrello 2018-08-22 15:26:03 -04:00
parent 5abe045e6c
commit a271837007
No known key found for this signature in database
GPG Key ID: F2AA5F2122351777

View File

@ -128,8 +128,9 @@ class SessionTimeoutMiddleware(object):
def process_response(self, request, response):
req_session = getattr(request, 'session', None)
if req_session and not req_session.is_empty():
request.session.set_expiry(request.session.get_expiry_age())
response['Session-Timeout'] = int(settings.SESSION_COOKIE_AGE)
expiry = int(settings.SESSION_COOKIE_AGE)
request.session.set_expiry(expiry)
response['Session-Timeout'] = expiry
return response