bug fix in memcached session handling: avoid overwriting/clearing old session data when data with another package name are stored
This commit is contained in:
parent
6651a1fc17
commit
0732f956c2
1 changed files with 8 additions and 2 deletions
|
@ -46,8 +46,14 @@ class SessionDataContainer(object):
|
|||
|
||||
def __setitem__(self, key, value):
|
||||
client = component.getUtility(IMemcachedClient)
|
||||
#print '***', key, value
|
||||
client.set(value, key, lifetime=self.lifetime, ns=self.namespace)
|
||||
oldValue = client.query(key, ns=self.namespace)
|
||||
if oldValue:
|
||||
oldValue.update(value)
|
||||
newValue = oldValue
|
||||
else:
|
||||
newValue = value
|
||||
#print '***', oldValue, value, newValue
|
||||
client.set(newValue, key, lifetime=self.lifetime, ns=self.namespace)
|
||||
|
||||
|
||||
class Session(object):
|
||||
|
|
Loading…
Add table
Reference in a new issue