\Horde_Session_Null

The null driver provides a set of methods for handling the administration and contents of the Horde session variable when the PHP session is not desired. Needed so things like application authentication can work within a single HTTP request when we don't need the overhead of a full PHP session.

Summary

Methods
Properties
Constants
__construct()
__get()
__set()
setup()
start()
regenerate()
clean()
close()
destroy()
isActive()
exists()
get()
set()
remove()
getToken()
checkToken()
getNonce()
checkNonce()
store()
retrieve()
purge()
shutdown()
$maxStore
$sessionHandler
$begin
$regenerate_due
$regenerate_interval
$session_data
BEGIN
ENCRYPTED
MODIFIED
PRUNE
REGENERATE
TYPE_ARRAY
TYPE_OBJECT
ENCRYPT
NOT_SERIALIZED
NONCE_ID
TOKEN_ID
DATA
_start()
$_active
$_cleansession
$_data
$_readonly
$_relogin
N/A
_getKey()
_subkeys()
No private properties found
N/A

Constants

BEGIN

BEGIN

ENCRYPTED

ENCRYPTED

MODIFIED

MODIFIED

PRUNE

PRUNE

REGENERATE

REGENERATE

TYPE_ARRAY

TYPE_ARRAY

TYPE_OBJECT

TYPE_OBJECT

ENCRYPT

ENCRYPT

NOT_SERIALIZED

NOT_SERIALIZED

NONCE_ID

NONCE_ID

TOKEN_ID

TOKEN_ID

DATA

DATA

Properties

$maxStore

$maxStore : integer

Maximum size of the pruneable data store.

Type

integer

$sessionHandler

$sessionHandler : \Horde_SessionHandler

The session handler object.

Type

\Horde_SessionHandler

$begin

$begin : integer

The timestamp when this session began (0 if session is not active).

Type

integer

$regenerate_due

$regenerate_due : boolean

True if session ID is due for regeneration (since 2.5.0).

Type

boolean

$regenerate_interval

$regenerate_interval : integer

The regeneration interval (since 2.5.0).

Type

integer

$session_data

$session_data : array

Manually set session data (since 2.5.0).

Type

array

$_active

$_active : boolean

Indicates that the session is active (read/write).

Type

boolean

$_cleansession

$_cleansession : boolean

Indicate that a new session ID has been generated for this page load.

Type

boolean

$_data

$_data : array

Pointer to the session data.

Type

array

$_readonly

$_readonly : boolean

Indicates that session data is read-only.

Type

boolean

$_relogin

$_relogin : integer

On re-login, indicate whether we were previously authenticated.

Type

integer

Methods

__construct()

__construct() 

Constructor.

__get()

__get(  $name) 

Parameters

$name

__set()

__set(  $name,   $value) 

Parameters

$name
$value

setup()

setup(boolean  $start = true, string  $cache_limiter = null, string  $session_id = null) 

Sets a custom session handler up, if there is one.

Parameters

boolean $start

Initiate the session?

string $cache_limiter

Override for the session cache limiter value.

string $session_id

The session ID to use.

start()

start() 

Starts the session.

regenerate()

regenerate() 

Regenerate the session ID.

clean()

clean() : boolean

Destroys any existing session on login and make sure to use a new session ID, to avoid session fixation issues. Should be called before checking a login.

Returns

boolean —

True if the session was cleaned.

close()

close() 

Close the current session.

destroy()

destroy() 

Destroy session data.

isActive()

isActive() : boolean

Is the current session active (read/write)?

Returns

boolean —

True if the current session is active.

exists()

exists(string  $app, string  $name) : boolean

Does the session variable exist?

Parameters

string $app

Application name.

string $name

Session variable name.

Returns

boolean —

True if session variable exists.

get()

get(string  $app, string  $name, integer  $mask) : mixed

Get the value of a session variable.

Parameters

string $app

Application name.

string $name

Session variable name.

integer $mask

One of:

  • Horde_Session::TYPE_ARRAY - Return an array value.
  • Horde_Session::TYPE_OBJECT - Return an object value.

Returns

mixed —

The value or null if the value doesn't exist.

set()

set(string  $app, string  $name, mixed  $value, integer  $mask) 

Sets the value of a session variable.

Parameters

string $app

Application name.

string $name

Session variable name.

mixed $value

Session variable value.

integer $mask

One of:

  • Horde_Session::TYPE_ARRAY: Force save as an array value.
  • Horde_Session::TYPE_OBJECT: Force save as an object value.
  • Horde_Session::ENCRYPT: Encrypt the value. (since 2.7.0)

remove()

remove(string  $app, string  $name = null) 

Remove session key(s).

Parameters

string $app

Application name.

string $name

Session variable name.

getToken()

getToken() : string

Returns the session token.

Returns

string —

Session token.

checkToken()

checkToken(string  $token) 

Checks the validity of the session token.

Parameters

string $token

Token to check.

Throws

\Horde_Exception

getNonce()

getNonce() : string

Returns a single-use, session nonce.

Returns

string —

Session nonce.

checkNonce()

checkNonce(string  $nonce) 

Checks the validity of the session nonce.

Parameters

string $nonce

Nonce to check.

Throws

\Horde_Exception

store()

store(  $data,   $prune = true,   $id = null) 

Parameters

$data
$prune
$id

retrieve()

retrieve(  $id) 

Parameters

$id

purge()

purge(  $id) 

Parameters

$id

shutdown()

shutdown() 

Shutdown tasks.

_start()

_start() 

Tasks to perform when starting a session.

_getKey()

_getKey(string  $app, string  $name) : string

Generates the unique storage key.

Parameters

string $app

Application name.

string $name

Session variable name.

Returns

string —

The unique storage key.

_subkeys()

_subkeys(string  $app, string  $name) : array

Return the list of subkeys for a master key.

Parameters

string $app

Application name.

string $name

Session variable name.

Returns

array —

Subkeyname (keys) and session variable name (values).