1.11.7.1 Checking Session Existence or Validity

If for any reason you have an application which has run for a long time, it is possible that the session has expired since the session was originally created or loaded.

To check if a session is still valid use manager.valid(). The valid() method returns True if the session is valid, False otherwise and raises a SessionError if the session no longer exists.

It is also conceivably possible that the session has been cleaned up and no longer exists. To check if a session exists use manager.exists(). The exists() method returns True if the session exists, False otherwise but makes no comment on whether or not it is still valid or has expired.