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):
|
def __setitem__(self, key, value):
|
||||||
client = component.getUtility(IMemcachedClient)
|
client = component.getUtility(IMemcachedClient)
|
||||||
#print '***', key, value
|
oldValue = client.query(key, ns=self.namespace)
|
||||||
client.set(value, key, lifetime=self.lifetime, 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):
|
class Session(object):
|
||||||
|
|
Loading…
Add table
Reference in a new issue