Class SessionHandler

Description

SessionHandler:: defines an API for implementing custom PHP session handlers.

Optional parameters:

   'memcache' - (boolean) Use memcache to cache session data?

$Horde: framework/SessionHandler/SessionHandler.php,v 1.13.10.20 2009/10/08 22:25:23 slusarz Exp $

Copyright 2002-2009 The Horde Project (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

Located in /SessionHandler/SessionHandler.php (line 21)


	
			
Direct descendents
Class Description
 class SessionHandler_dbm SessionHandler:: implementation for DBM files.
 class SessionHandler_ldap SessionHandler implementation for LDAP directories.
 class SessionHandler_memcache SessionHandler:: implementation for memcache.
 class SessionHandler_mysql SessionHandler:: implementation for MySQL (native).
 class SessionHandler_none SessionHandler implementation for PHP's built-in session handler.
 class SessionHandler_oci8 SessionHandler:: implementation for Oracle 8i (native).
 class SessionHandler_pgsql PostgreSQL Session Handler for PHP (native).
 class SessionHandler_sql SessionHandler implementation for PHP's PEAR database abstraction layer.
Variable Summary
 boolean $_connected
 boolean $_force
 array $_params
 string $_sig
Method Summary
 SessionHandler SessionHandler ([array $params = array()])
 void __destruct ()
 boolean close ()
 boolean destroy (string $id)
 mixed &factory (string $driver, [array $params = null])
 boolean gc ([integer $maxlifetime = 300])
 array getSessionIDs ()
 array getSessionsInfo ()
 array listAuthenticatedUsers ([boolean $date = false])
 boolean open ([string $save_path = null], [string $session_name = null])
 string read (string $id)
 mixed &singleton (string $driver, [array $params = null])
 boolean write (string $id, string $session_data)
Variables
boolean $_connected = false (line 49)

Has a connection been made to the backend?

boolean $_force = false (line 42)

Force saving the session data?

array $_params = array() (line 28)

Hash containing connection parameters.

string $_sig (line 35)

Initial session data signature.

Methods
Constructor SessionHandler (line 56)

Constructs a new SessionHandler object.

SessionHandler SessionHandler ([array $params = array()])
  • array $params: A hash containing connection parameters.
Destructor __destruct (line 67)

Destructor (PHP 5 only).

This is necessary as of PHP 5.0.5 because objects are not available when the write() handler is called at the end of a session access.

void __destruct ()
close (line 198)

Close the SessionHandler backend.

  • return: True on success, false otherwise.
boolean close ()
countAuthenticatedUsers (line 355)

Determine the number of currently logged in users.

getSessionsInfo() should be called instead.

  • return: A count of logged in users or PEAR_Error on error.
  • deprecated:
integer countAuthenticatedUsers ()
destroy (line 299)

Destroy the data for a particular session identifier in the SessionHandler backend.

This method should only be called internally by PHP via session_set_save_handler().

  • return: True on success, false otherwise.
  • abstract:
boolean destroy (string $id)
  • string $id: The session identifier.

Redefined in descendants as:
factory (line 84)

Attempts to return a concrete SessionHandler instance based on $driver.

  • return: The newly created concrete SessionHandler instance, or false on an error.
mixed &factory (string $driver, [array $params = null])
  • string $driver: The type of concrete SessionHandler subclass to return.
  • array $params: A hash containing any additional configuration or connection parameters a subclass might need.
gc (line 315)

Garbage collect stale sessions from the SessionHandler backend.

This method should only be called internally by PHP via session_set_save_handler().

  • return: True on success, false otherwise.
  • abstract:
boolean gc ([integer $maxlifetime = 300])
  • integer $maxlifetime: The maximum age of a session.

Redefined in descendants as:
getSessionIDs (line 342)

Get a list of the valid session identifiers.

  • return: A list of valid session identifiers. Returns PEAR_Error on error.
  • abstract:
array getSessionIDs ()

Redefined in descendants as:
getSessionsInfo (line 401)

Returns a list of authenticated users and data about their session.

  • return: For authenticated users, the sessionid as a key and the information returned from Auth::readSessionData() as values. Returns PEAR_Error on error.
  • since: Horde 3.2
array getSessionsInfo ()
listAuthenticatedUsers (line 374)

Returns a list of currently logged in users.

getSessionsInfo() should be called instead.

  • return: A list of logged in users or PEAR_Error on error.
  • deprecated:
array listAuthenticatedUsers ([boolean $date = false])
  • boolean $date: Prefix the timestamp to the username?
open (line 160)

Open the SessionHandler backend.

  • return: True on success, false otherwise.
boolean open ([string $save_path = null], [string $session_name = null])
  • string $save_path: The path to the session object.
  • string $session_name: The name of the session.
read (line 228)

Read the data for a particular session identifier from the SessionHandler backend.

This method should only be called internally by PHP via session_set_save_handler().

  • return: The session data.
string read (string $id)
  • string $id: The session identifier.
singleton (line 140)

Attempts to return a reference to a concrete SessionHandler instance based on $driver. It will only create a new instance if no SessionHandler instance with the same parameters currently exists.

This method must be invoked as: $var = &SessionHandler::singleton()

  • return: The created concrete SessionHandler instance, or PEAR_Error on error.
mixed &singleton (string $driver, [array $params = null])
  • string $driver: See SessionHandler::factory().
  • array $params: See SessionHandler::factory().
write (line 261)

Write session data to the SessionHandler backend.

This method should only be called internally by PHP via session_set_save_handler().

  • return: True on success, false otherwise.
boolean write (string $id, string $session_data)
  • string $id: The session identifier.
  • string $session_data: The session data.

Documentation generated on Sun, 30 Jan 2011 05:21:17 +0000 by phpDocumentor 1.4.3