Overview

Packages

  • Actions
  • Codegen
  • Controls
    • Base
  • DatabaseAdapters
  • Events
  • None
  • Sessions
  • Tests

Classes

  • QDbBackedSessionHandler
  • Overview
  • Package
  • Class

Class QDbBackedSessionHandler

Created by vaibhav on 1/28/12 (3:34 AM).

This file contains the QDbBackedSessionHandler class.

Relies on a SQL database table with the following columns: id - STRING primary key last_access_time - INT data - BLOB or BINARY or VARBINARY. Must be a binary safe column, and capable of holding the maximum size of session data for your app, which depends on what you are putting in the $_SESSION variable.

QBaseClass
Extended by QDbBackedSessionHandler
Package: Sessions
Located at includes/framework/QDbBackedSessionHandler.class.php
Methods summary
public static boolean
# Initialize( integer $intDbIndex = 1, string $strTableName = "qc_session" )

Parameters

$intDbIndex
The index in the database array
$strTableName
The table name to be used for saving sessions.

Returns

boolean

Throws

Exception|QCallerException|QInvalidCastException
public static boolean
# SessionOpen( string $save_path, string $session_name )

Open the session (used by PHP when the session handler is active)

Open the session (used by PHP when the session handler is active)

Parameters

$save_path
$session_name

Returns

boolean
public static boolean
# SessionClose( )

Close the session (used by PHP when the session handler is active)

Close the session (used by PHP when the session handler is active)

Returns

boolean
public static string
# SessionRead( string $id )

Read the session data (used by PHP when the session handler is active)

Read the session data (used by PHP when the session handler is active)

Parameters

$id

Returns

string
the session data, base64 decoded
public static boolean
# SessionExists( string $id )

Tells whether a session by given name exists or not (used by PHP when the session handler is active)

Tells whether a session by given name exists or not (used by PHP when the session handler is active)

Parameters

$id
Session ID

Returns

boolean
does the session exist or not
public static boolean
# SessionWrite( string $id, string $strSessionData )

Write data to the session

Write data to the session

Parameters

$id
The session ID
$strSessionData
Data to be written to the Session whose ID was supplied

Returns

boolean
public static boolean
# SessionDestroy( string $id )

Destroy the session for a given session ID

Destroy the session for a given session ID

Parameters

$id
The session ID

Returns

boolean
public static boolean
# SessionGarbageCollect( integer $intMaxSessionLifetime )

Garbage collect session data (delete/destroy sessions which are older than the max allowed lifetime)

Garbage collect session data (delete/destroy sessions which are older than the max allowed lifetime)

Parameters

$intMaxSessionLifetime
The max session lifetime (in seconds)

Returns

boolean
Methods inherited from QBaseClass
OverrideAttributes(), __call(), __get(), __set()
Properties summary
protected static integer $intDbIndex

The index in the database array

The index in the database array

#
protected static string $strTableName

The table name to be used for saving sessions.

The table name to be used for saving sessions.

#
protected static string $strSessionName

The session name to be used for saving sessions.

The session name to be used for saving sessions.

# ''
public static boolean $blnEncrypt

Whether to encrypt the session data. Highly recommended whenever sessions can authenticate a user.

Whether to encrypt the session data. Highly recommended whenever sessions can authenticate a user.

# true
public static boolean $blnCompress

Whether to compress the session data.

Whether to compress the session data.

# true
API documentation generated by ApiGen