I'm using a cookie session and I just tried to delete something from the session for the first time, and I got this error:
session.delete_item("key")
File "gaeutils/sessions.py", line 1055, in delete_item
self.__delitem__(keyname)
File "gaeutils/sessions.py", line 1067, in __delitem__
sessdata = self._get(keyname = keyname)
File "gaeutils/sessions.py", line 677, in _get
return self.session.get_item(keyname)
AttributeError: 'Session' object has no attribute 'session'
There does appear to be support for deleting from cookie sessions, but that line in the stack trace - 1067 - is throwing an error before the code can get to the cookie-specific section. The problem is that it's calling into a method (self._get) that is not meant to support cookie sessions.
An easy fix (though I'm not sure if this is the best way) is to check for the session attribute before calling into it:
I'm using a cookie session and I just tried to delete something from the session for the first time, and I got this error:
There does appear to be support for deleting from cookie sessions, but that line in the stack trace - 1067 - is throwing an error before the code can get to the cookie-specific section. The problem is that it's calling into a method (self._get) that is not meant to support cookie sessions.
An easy fix (though I'm not sure if this is the best way) is to check for the session attribute before calling into it:
I think that patch still allows for the old behavior while now supporting deleting from cookie sessions as well.