SessionManager Class Reference
[Session]

Implements PHP methods for a custom session storage handler (see http://php.net/session). More...

List of all members.

Public Member Functions

 close ()
 destroy ($sessionId)
 gc ($maxlifetime)
getManager ()
getUserSession ()
 open ()
 read ($sessionId)
 regenerateSessionId ()
 SessionManager (&$sessionDao)
 updateSessionCookie ($sessionId=false, $expireTime=0)
 updateSessionLifetime ($expireTime=0)
 write ($sessionId, $data)

Public Attributes

 $sessionDao
 $userSession


Detailed Description

Implements PHP methods for a custom session storage handler (see http://php.net/session).

Definition at line 18 of file SessionManager.inc.php.


Member Function Documentation

SessionManager.close (  ) 

Close a session. Does nothing; only here to satisfy PHP session handler requirements.

Returns:
boolean

Definition at line 133 of file SessionManager.inc.php.

SessionManager.destroy ( sessionId  ) 

Destroy (delete) a session.

Parameters:
$sessionId string
Returns:
boolean

Definition at line 173 of file SessionManager.inc.php.

SessionManager.gc ( maxlifetime  ) 

Garbage collect unused session data. TODO: Use $maxlifetime instead of assuming 24 hours?

Parameters:
$maxlifetime int the number of seconds after which data will be seen as "garbage" and cleaned up
Returns:
boolean

Definition at line 183 of file SessionManager.inc.php.

References Config.getVar().

& SessionManager.getManager (  ) 

& SessionManager.getUserSession (  ) 

Get the session associated with the current request.

Returns:
Session

Definition at line 115 of file SessionManager.inc.php.

SessionManager.open (  ) 

Open a session. Does nothing; only here to satisfy PHP session handler requirements.

Returns:
boolean

Definition at line 124 of file SessionManager.inc.php.

SessionManager.read ( sessionId  ) 

Read session data from database.

Parameters:
$sessionId string
Returns:
boolean

Definition at line 142 of file SessionManager.inc.php.

SessionManager.regenerateSessionId (  ) 

Regenerate the session ID for the current user session. This is useful to guard against the "session fixation" form of hijacking by changing the user's session ID after they have logged in (in case the original session ID had been pre-populated).

Returns:
boolean

Definition at line 204 of file SessionManager.inc.php.

References updateSessionCookie().

SessionManager.SessionManager ( &$  sessionDao  ) 

Constructor. Initialize session configuration and set PHP session handlers. Attempts to rejoin a user's session if it exists, or create a new session otherwise.

Definition at line 31 of file SessionManager.inc.php.

References $sessionDao, Request.getBasePath(), Request.getRemoteAddr(), Request.getUserAgent(), Config.getVar(), and updateSessionLifetime().

Referenced by getManager().

SessionManager.updateSessionCookie ( sessionId = false,
expireTime = 0 
)

Resubmit the session cookie.

Parameters:
$sessionId string new session ID (or false to keep current ID)
$expireTime int new expiration time in seconds (0 = current session)
Returns:
boolean

Definition at line 193 of file SessionManager.inc.php.

Referenced by regenerateSessionId(), and updateSessionLifetime().

SessionManager.updateSessionLifetime ( expireTime = 0  ) 

Change the lifetime of the current session cookie.

Parameters:
$expireTime int new expiration time in seconds (0 = current session)
Returns:
boolean

Definition at line 244 of file SessionManager.inc.php.

References updateSessionCookie().

Referenced by SessionManager().

SessionManager.write ( sessionId,
data 
)

Save session data to database.

Parameters:
$sessionId string
$data array
Returns:
boolean

Definition at line 158 of file SessionManager.inc.php.


Member Data Documentation

SessionManager.$sessionDao

The DAO for accessing Session objects

Definition at line 21 of file SessionManager.inc.php.

Referenced by SessionManager().

SessionManager.$userSession

The Session associated with the current request

Definition at line 24 of file SessionManager.inc.php.


The documentation for this class was generated from the following file:

Generated on Mon Jul 14 10:55:47 2008 for Open Journal Systems by  doxygen 1.5.6