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_Storage_Sql

SessionHandler storage implementation for SQL databases.

Uses the following SQL table structure:

CREATE TABLE horde_sessionhandler (
    VARCHAR(32) NOT NULL,
    session_lastmodified   INT NOT NULL,
    session_data           LONGBLOB,
    -- Or, on some DBMS systems:
    --  session_data           IMAGE,

    PRIMARY KEY (session_id)
);

CREATE INDEX session_lastmodified_idx ON horde_sessionhandler (session_lastmodified);

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.

Horde_SessionHandler_Storage
Extended by Horde_SessionHandler_Storage_Sql
Package: SessionHandler
Category: Horde
License: LGPL 2.1
Author: Mike Cochrane mike@graftonhall.co.nz
Located at Horde/SessionHandler/Storage/Sql.php
Methods summary
public
# __construct( array $params = array() )

Constructor.

Constructor.

Parameters

$params
Parameters: <pre><span class="php-quote">'db'</span> - (Horde_Db_Adapter) [REQUIRED] The DB instance. <span class="php-quote">'table'</span> - (string) The name of the sessions table. <span class="php-keyword1">DEFAULT</span>: <span class="php-quote">'horde_sessionhandler'</span></pre>

Throws

InvalidArgumentException

Overrides

Horde_SessionHandler_Storage::__construct()
public
# open( string $save_path = null, string $session_name = null )

Parameters

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

Throws

Horde_SessionHandler_Exception
public
# close( )

Throws

Horde_SessionHandler_Exception
public string
# read( string $id )

Parameters

$id
The session identifier.

Returns

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

Parameters

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

Returns

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

Parameters

$id
The session identifier.

Returns

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

Parameters

$maxlifetime
The maximum age of a session.

Returns

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

Returns

array
A list of valid session identifiers.

Throws

Horde_SessionHandler_Exception
Methods inherited from Horde_SessionHandler_Storage
setLogger()
Properties inherited from Horde_SessionHandler_Storage
$readonly
API documentation generated by ApiGen