users can switch between sessions storage types

This commit is contained in:
Massimo
2012-10-16 10:25:28 -05:00
parent 00f1ab4393
commit 90098648df
3 changed files with 15 additions and 8 deletions
+2
View File
@@ -116,6 +116,8 @@ def secure_dumps(data,encryption_key,hash_key=None):
return signature+':'+encrypted_data
def secure_loads(data,encryption_key,hash_key=None):
if not ':' in data:
return None
if not hash_key:
hash_key = hashlib.sha1(encryption_key).hexdigest()
signature, encrypted_data = data.split(':',1)