PHP Class Horde_SessionHandler, horde

Copyright 2002-2016 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.
Author: Michael Slusarz ([email protected])
Show file Open project: horde/horde

Public Properties

Property Type Description
$changed boolean If true, indicates the session data has changed.

Protected Properties

Property Type Description
$_connected boolean Has a connection been made to the backend?
$_logger Horde_Log_Logger A logger instance.
$_params array Configuration parameters.
$_sig string Initial session data signature.
$_storage Horde_SessionHandler_Storage The storage object.

Public Methods

Method Description
__construct ( Horde_SessionHandler_Storage $storage, array $params = [] ) Constructor.
__destruct ( ) Destructor.
close ( ) : boolean Close the backend.
destroy ( string $id ) : boolean Destroy the data for a particular session identifier in the backend.
gc ( integer $maxlifetime = 300 ) : boolean Garbage collect stale sessions from the backend.
getSessionIDs ( ) : array Get a list of the valid session identifiers.
getSessionsInfo ( ) : array Returns a list of authenticated users and data about their session.
open ( string $save_path = null, string $session_name = null ) : boolean Open the backend.
read ( string $id ) : string Read the data for a particular session identifier from the backend.
write ( string $id, string $session_data ) : boolean Write session data to the backend.

Method Details

__construct() public method

Constructor.
public __construct ( Horde_SessionHandler_Storage $storage, array $params = [] )
$storage Horde_SessionHandler_Storage The storage object.
$params array Configuration parameters:
  - logger: (Horde_Log_Logger) A logger instance.
            DEFAULT: No logging
  - no_md5: (boolean) If true, does not do MD5 signatures of the
            session to determine if the session has changed (calling
            code is responsible for marking $changed as true when the
            session data has changed).
            DEFAULT: false
  - noset: (boolean) If true, don'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

__destruct() public method

Destructor.
public __destruct ( )

close() public method

Close the backend.
public close ( ) : boolean
return boolean True on success, false otherwise.

destroy() public method

This method should only be called internally by PHP via session_set_save_handler().
public destroy ( string $id ) : boolean
$id string The session identifier.
return boolean True on success, false otherwise.

gc() public method

This method should only be called internally by PHP via session_set_save_handler().
public gc ( integer $maxlifetime = 300 ) : boolean
$maxlifetime integer The maximum age of a session.
return boolean True on success, false otherwise.

getSessionIDs() public method

Get a list of the valid session identifiers.
public getSessionIDs ( ) : array
return array A list of valid session identifiers.

getSessionsInfo() public method

Returns a list of authenticated users and data about their session.
public getSessionsInfo ( ) : array
return 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.

open() public method

Open the backend.
public open ( string $save_path = null, string $session_name = null ) : boolean
$save_path string The path to the session object.
$session_name string The name of the session.
return boolean True on success, false otherwise.

read() public method

This method should only be called internally by PHP via session_set_save_handler().
public read ( string $id ) : string
$id string The session identifier.
return string The session data.

write() public method

This method should only be called internally by PHP via session_set_save_handler().
public write ( string $id, string $session_data ) : boolean
$id string The session identifier.
$session_data string The session data.
return boolean True on success, false otherwise.

Property Details

$_connected protected property

Has a connection been made to the backend?
protected bool $_connected
return boolean

$_logger protected property

A logger instance.
protected Horde_Log_Logger $_logger
return Horde_Log_Logger

$_params protected property

Configuration parameters.
protected array $_params
return array

$_sig protected property

Initial session data signature.
protected string $_sig
return string

$_storage protected property

The storage object.
protected Horde_SessionHandler_Storage $_storage
return Horde_SessionHandler_Storage

$changed public property

If true, indicates the session data has changed.
public bool $changed
return boolean