twisted :: web :: server :: Session :: Class Session
[hide private]

Class Session

 persisted.styles.Versioned --+    
                              |    
python.components.Componentized --+
                                  |
                                 Session

A user's session with a system.

This utility class contains no functionality, but is used to represent a session.

Instance Methods [hide private]
 
__init__(self, site, uid)
Initialize a session with a unique ID for that session.
 
_getTime(self)
Return current time used for session validity.
 
checkExpired(self)
Is it time for me to expire?
 
expire(self)
Expire/logout of the session.
 
notifyOnExpire(self, callback)
Call this callback when the session expires or logs out.
 
startCheckingExpiration(self, lifetime)
Start expiration tracking.
 
touch(self)
Notify session modification.

Inherited from python.components.Componentized: __conform__, addAdapter, addComponent, getComponent, locateAdapterClass, removeComponent, setAdapter, setComponent, unsetComponent

Inherited from persisted.styles.Versioned: __getstate__, __setstate__, versionUpgrade

Class Variables [hide private]

Inherited from python.components.Componentized: persistenceVersion

Inherited from persisted.styles.Versioned: persistenceForgets

Instance Variables [hide private]
  loopFactory
factory for creating task.LoopingCall.
  sessionTimeout = 900
timeout of a session, in seconds.
Method Details [hide private]

__init__(self, site, uid)
(Constructor)

 

Initialize a session with a unique ID for that session.

Overrides: python.components.Componentized.__init__

checkExpired(self)

 

Is it time for me to expire?

If I haven't been touched in fifteen minutes, I will call my expire method.

startCheckingExpiration(self, lifetime)

 

Start expiration tracking.

Parameters:
  • lifetime (int or float) - The number of seconds this session is allowed to be idle before it expires.
Returns:
None

Instance Variable Details [hide private]

loopFactory

factory for creating task.LoopingCall. Mainly for testing.
Value:
twisted.internet.task.LoopingCall