Table of Contents

Class: Session qm/web.py

A persistent user session.

A Session object represents an ongoing user interaction with the web server.

Methods   
GetId
GetUser
GetUserId
IsDefaultUser
IsExpired
Touch
Validate
__init__
  GetId 
GetId ( self )

Return the session ID.

  GetUser 
GetUser ( self )

Return the user record for the owning user.

returns
A qm.user.User object.
  GetUserId 
GetUserId ( self )

Return the ID of the user who owns this session.

  IsDefaultUser 
IsDefaultUser ( self )

Return true if the owning user is the default user.

  IsExpired 
IsExpired ( self )

Return true if this session has expired.

  Touch 
Touch ( self )

Update the last access time on the session to now.

  Validate 
Validate ( self,  request )

Make sure the session is OK for a request.

request
A WebRequest object.
raises
InvalidSessionError if the session is invalid for the request.
Exceptions   
InvalidSessionError, qm.error( "session expired" )
InvalidSessionError, qm.error( "session wrong IP" )
  __init__ 
__init__ (
        self,
        request,
        user_id,
        expiration_timeout=21600,
        )

Create a new session.

request
A WebRequest object in response to which this session is created.
user_id
The ID of the user owning the session.
'expiration_timeout
The expiration time, in seconds. If a session is not accessed for this duration, it is expired and no longer usable.

Table of Contents

This document was automatically generated on Mon Jan 3 09:42:29 2005 by HappyDoc version 2.1