eZ Publish Community Project (Legacy Stack) 2013.4
Class

ezpSessionHandlerDB

class ezpSessionHandlerDB extends ezpSessionHandler

DB session handler class

Constants

GC_TIMEOUT_MARGIN

GC_MAX_EXECUTION_TIME

GC_MAX_EXECUTION_TIME_CLI

Properties

int|false $gcSessionsPrIteration Specifies how many sessions should be deleted pr iteration when garbage collecting sessions (to avoid sql calls that lock db)

Methods

__construct(bool $userHasCookie = false)

__construct

from ezpSessionHandler
bool isConnected()

Checks if session handler is connected with backend.

bool setSaveHandler()

Set it self as save handler

from ezpSessionHandler
bool open(string $savePath, string $sessionName)

Session open handler

from ezpSessionHandler
bool close()

Session close handler

from ezpSessionHandler
string|false read(string $sessionId)

Session read handler

bool write(string $sessionId, string $sessionData)

Session write handler

bool destroy(string $sessionId)

Session destroy handler

bool regenerate(bool $updateBackendData = true)

Regenerate session id

bool gc(int $maxLifeTime)

Session gc (garbageCollector) handler

bool cleanup()

Remove all session data (Truncate table)

deleteByUserIDs(array $userIDArray)

Remove all session data for a specific user

static int|null count()

Counts the number of session and returns it.

static bool hasBackendAccess()

Signals that handler has direct access to backend, thus is cable of supporting features like gc, cleanup, delete & count.

from ezpSessionHandler
static bool dbRequired()

Signals that handler requires db instance

from ezpSessionHandler
bool sessionStart()

Starts the session.

from ezpSessionHandler

Details

in ezpSessionHandler at line 31
public __construct(bool $userHasCookie = false)

__construct

Parameters

bool $userHasCookie

at line 41
public bool isConnected()

Checks if session handler is connected with backend.

Return Value

bool

in ezpSessionHandler at line 51
public bool setSaveHandler()

Set it self as save handler

Return Value

bool

in ezpSessionHandler at line 72
public bool open(string $savePath, string $sessionName)

Session open handler

Parameters

string $savePath
string $sessionName

Return Value

bool

in ezpSessionHandler at line 82
public bool close()

Session close handler

Return Value

bool

at line 53
public string|false read(string $sessionId)

Session read handler

Parameters

string $sessionId

Return Value

string|false Binary session data

at line 91
public bool write(string $sessionId, string $sessionData)

Session write handler

Parameters

string $sessionId
string $sessionData Binary session data

Return Value

bool

at line 135
public bool destroy(string $sessionId)

Session destroy handler

Parameters

string $sessionId

Return Value

bool

at line 155
public bool regenerate(bool $updateBackendData = true)

Regenerate session id

Parameters

bool $updateBackendData (true if we want to keep session data with the new session id)

Return Value

bool

at line 190
public bool gc(int $maxLifeTime)

Session gc (garbageCollector) handler

Parameters

int $maxLifeTime In seconds

Return Value

bool

at line 243
public bool cleanup()

Remove all session data (Truncate table)

Return Value

bool

at line 260
public deleteByUserIDs(array $userIDArray)

Remove all session data for a specific user

Parameters

array $userIDArray

at line 277
static public int|null count()

Counts the number of session and returns it.

Return Value

int|null Returns null if handler does not support this.

in ezpSessionHandler at line 172
static public bool hasBackendAccess()

Signals that handler has direct access to backend, thus is cable of supporting features like gc, cleanup, delete & count.

Return Value

bool

in ezpSessionHandler at line 182
static public bool dbRequired()

Signals that handler requires db instance

Return Value

bool

in ezpSessionHandler at line 194
public bool sessionStart()

Starts the session.

Override this method if you need to delegate session start to an external system (e.g. Symfony stack in eZ Publish 5)

Return Value

bool