\Horde_SessionHandler_Storage_Mongo

MongoDB storage driver.

Summary

Methods
Properties
Constants
__construct()
__sleep()
setLogger()
open()
close()
read()
write()
destroy()
gc()
getSessionIDs()
checkMongoIndices()
createMongoIndices()
$readonly
DATA
LOCK
MODIFIED
SID
No protected methods found
$_params
$_db
$_locked
$_indices
N/A
No private methods found
No private properties found
N/A

Constants

DATA

DATA

LOCK

LOCK

MODIFIED

MODIFIED

SID

SID

Properties

$readonly

$readonly : boolean

Access session read-only?

Type

boolean

$_params

$_params : array

Hash containing connection parameters.

Type

array

$_db

$_db : \MongoCollection

MongoCollection object for the storage table.

Type

\MongoCollection

$_locked

$_locked : boolean

Is the session locked.

Type

boolean

$_indices

$_indices : array

Indices list.

Type

array

Methods

__construct()

__construct(array  $params = array()) 

Constructor.

Parameters

array $params

Parameters:

collection: (string) The collection to store data in.
mongo_db: (Horde_Mongo_Client) [REQUIRED] The Mongo client object.

__sleep()

__sleep() 

Storage objects do not support serialization.

setLogger()

setLogger(\Horde_Log_Logger  $log) 

Set the logger object.

Parameters

\Horde_Log_Logger $log

open()

open(string  $save_path = null, string  $session_name = null) 

Open the backend.

Parameters

string $save_path

The path to the session object.

string $session_name

The name of the session.

close()

close() 

Close the backend.

read()

read(string  $id) : string

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

Parameters

string $id

The session identifier.

Returns

string —

The session data.

write()

write(string  $id, string  $session_data) : boolean

Write session data to the backend.

Parameters

string $id

The session identifier.

string $session_data

The session data.

Returns

boolean —

True on success, false otherwise.

destroy()

destroy(string  $id) : boolean

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

string $id

The session identifier.

Returns

boolean —

True on success, false otherwise.

gc()

gc(integer  $maxlifetime = 300) : boolean

Garbage collect stale sessions from the backend.

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

Parameters

integer $maxlifetime

The maximum age of a session.

Returns

boolean —

True on success, false otherwise.

getSessionIDs()

getSessionIDs() : array

Get a list of the valid session identifiers.

Returns

array —

A list of valid session identifiers.

checkMongoIndices()

checkMongoIndices() 

createMongoIndices()

createMongoIndices()