sessions: fixed more problems with redis sessions cleanup errors
This commit is contained in:
parent
69428fe244
commit
148d5f8463
1 changed files with 5 additions and 1 deletions
|
|
@ -20,6 +20,8 @@ import os
|
|||
import re
|
||||
import time
|
||||
import datetime
|
||||
|
||||
import binascii
|
||||
import dateutil
|
||||
import dateutil.relativedelta
|
||||
import pickle
|
||||
|
|
@ -225,11 +227,13 @@ class RedisAuthSessions(BaseAuthSessions):
|
|||
data = client.get(key)
|
||||
if data:
|
||||
accessed_time = 0
|
||||
data = base64.b64decode(data)
|
||||
|
||||
try:
|
||||
data = base64.b64decode(data)
|
||||
json_data = pickle.loads(data)
|
||||
accessed_time = json_data['_accessed_time']
|
||||
except binascii.Error:
|
||||
accessed_time = 0
|
||||
except pickle.UnpicklingError:
|
||||
accessed_time = 0
|
||||
except KeyError:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue