|
@@ -206,6 +206,9 @@ class SessionBase:
|
|
|
|
|
|
_session = property(_get_session)
|
|
_session = property(_get_session)
|
|
|
|
|
|
|
|
+ def get_session_cookie_age(self):
|
|
|
|
+ return settings.SESSION_COOKIE_AGE
|
|
|
|
+
|
|
def get_expiry_age(self, **kwargs):
|
|
def get_expiry_age(self, **kwargs):
|
|
"""Get the number of seconds until the session expires.
|
|
"""Get the number of seconds until the session expires.
|
|
|
|
|
|
@@ -225,7 +228,7 @@ class SessionBase:
|
|
expiry = self.get('_session_expiry')
|
|
expiry = self.get('_session_expiry')
|
|
|
|
|
|
if not expiry: # Checks both None and 0 cases
|
|
if not expiry: # Checks both None and 0 cases
|
|
- return settings.SESSION_COOKIE_AGE
|
|
|
|
|
|
+ return self.get_session_cookie_age()
|
|
if not isinstance(expiry, datetime):
|
|
if not isinstance(expiry, datetime):
|
|
return expiry
|
|
return expiry
|
|
delta = expiry - modification
|
|
delta = expiry - modification
|
|
@@ -249,7 +252,7 @@ class SessionBase:
|
|
|
|
|
|
if isinstance(expiry, datetime):
|
|
if isinstance(expiry, datetime):
|
|
return expiry
|
|
return expiry
|
|
- expiry = expiry or settings.SESSION_COOKIE_AGE # Checks both None and 0 cases
|
|
|
|
|
|
+ expiry = expiry or self.get_session_cookie_age()
|
|
return modification + timedelta(seconds=expiry)
|
|
return modification + timedelta(seconds=expiry)
|
|
|
|
|
|
def set_expiry(self, value):
|
|
def set_expiry(self, value):
|