Overview

Packages

  • SessionHandler

Classes

  • Horde_SessionHandler
  • Horde_SessionHandler_Exception
  • Horde_SessionHandler_Storage
  • Horde_SessionHandler_Storage_Builtin
  • Horde_SessionHandler_Storage_External
  • Horde_SessionHandler_Storage_File
  • Horde_SessionHandler_Storage_Memcache
  • Horde_SessionHandler_Storage_Sql
  • Horde_SessionHandler_Storage_Stack
  • Overview
  • Package
  • Class
  • Tree

Class Horde_SessionHandler

This class provides the interface to the session storage backend.

Copyright 2002-2012 Horde LLC (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.

Package: SessionHandler
Category: Horde
License: LGPL 2.1
Author: Michael Slusarz slusarz@horde.org
Located at Horde/SessionHandler.php
Methods summary
public
# __construct( Horde_SessionHandler_Storage $storage, array $params = array() )

Constructor.

Constructor.

Parameters

$storage
The storage object.
$params
Configuration parameters: <pre>logger - (Horde_Log_Logger) A logger instance. <span class="php-keyword1">DEFAULT</span>: No logging no_md5 - (boolean) <span class="php-keyword1">If</span> <span class="php-keyword1">true</span>, does not <span class="php-keyword1">do</span> <span class="php-keyword2">MD5</span> signatures of the session to determine <span class="php-keyword1">if</span> the session has changed. <span class="php-keyword1">If</span> <span class="php-keyword1">true</span>, calling code is responsible <span class="php-keyword1">for</span> marking <span class="php-var">$changed</span> <span class="php-keyword1">as</span> <span class="php-keyword1">true</span> when the session data has changed. <span class="php-keyword1">DEFAULT</span>: <span class="php-keyword1">false</span> noset - (boolean) <span class="php-keyword1">If</span> <span class="php-keyword1">true</span>, don<span class="php-quote">'t set the save handler. DEFAULT: false parse - (callback) A callback function that parses session information into an array. Is passed the raw session data as the only argument; expects either false or an array of session data as a return. DEFAULT: No</span></pre>
public
# __destruct( )

Destructor.

Destructor.

public boolean
# open( string $save_path = null, string $session_name = null )

Open the backend.

Open the backend.

Parameters

$save_path
The path to the session object.
$session_name
The name of the session.

Returns

boolean
True on success, false otherwise.
public boolean
# close( )

Close the backend.

Close the backend.

Returns

boolean
True on success, false otherwise.
public string
# read( string $id )

Read the data for a particular session identifier from the backend. This method should only be called internally by PHP via session_set_save_handler().

Read the data for a particular session identifier from the backend. This method should only be called internally by PHP via session_set_save_handler().

Parameters

$id
The session identifier.

Returns

string
The session data.
public boolean
# write( string $id, string $session_data )

Write session data to the backend. This method should only be called internally by PHP via session_set_save_handler().

Write session data to the backend. This method should only be called internally by PHP via session_set_save_handler().

Parameters

$id
The session identifier.
$session_data
The session data.

Returns

boolean
True on success, false otherwise.
public boolean
# destroy( string $id )

Destroy the data for a particular session identifier in the backend. This method should only be called internally by PHP via session_set_save_handler().

Destroy the data for a particular session identifier in the backend. This method should only be called internally by PHP via session_set_save_handler().

Parameters

$id
The session identifier.

Returns

boolean
True on success, false otherwise.
public boolean
# gc( integer $maxlifetime = 300 )

Garbage collect stale sessions from the backend. This method should only be called internally by PHP via session_set_save_handler().

Garbage collect stale sessions from the backend. This method should only be called internally by PHP via session_set_save_handler().

Parameters

$maxlifetime
The maximum age of a session.

Returns

boolean
True on success, false otherwise.
public array
# getSessionIDs( )

Get a list of the valid session identifiers.

Get a list of the valid session identifiers.

Returns

array
A list of valid session identifiers.

Throws

Horde_SessionHandler_Exception
public array
# getSessionsInfo( )

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

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

Returns

array

For authenticated users, the sessionid as a key and the session information as value. If no parsing function was provided, will always return an empty array.

Throws

Horde_SessionHandler_Exception
Properties summary
public boolean $changed

If true, indicates the session data has changed.

If true, indicates the session data has changed.

# false
API documentation generated by ApiGen