clear session method
|Reported by:||Owned by:||Adrian Holovaty|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
For some types of applications it's necessary/desirable to clear session variables at specific events (e.g. server start, user login). It would be convenient to have the following (untested) method available in SessionWrapper:
def clear(self): try: self._session_cache.clear() except AttributeError: pass self._session.clear()
I'm aware the Django policy is to not make it easy for users to delete data, but this is pretty explicit that you want to clear your session data.