lib/ezsession/classes/ezpsessionhandler.php
File containing abstract session handler
- Copyright
- Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.
- License
- eZ Business Use License Agreement Version 2.0
- Package
- lib
- Version
- 4.6.0
\ezpSessionHandler
Abstract session handler class to extend
CALLBACKS: destroy, gc, regenerate & cleanup functions MUST implement callbacks. Definition is documented in functions on this class, examples can be found in the handlers and examples of use can be sessin in ezsession.php class doc section.
- Children
- \ezpSessionHandlerPHP
- \ezpSessionHandlerDB
- Abstract
- Since
- 4.4
Methods


__construct(
bool $userHasCookie
=
false
)
:
void
__construct
Name | Type | Description |
---|---|---|
$userHasCookie | bool |


cleanup(
)
:
bool
Remove all session data Callback: "cleanup_[pre|post]" eZDB $db
Type | Description |
---|---|
bool |


count(
)
:
int
Counts the number of session and returns it.
Type | Description |
---|---|
int | Returns -1 if handler does not support this. |


deleteByUserIDs(
\array(int) $userIDArray
)
:
void
Remove all session data for a specific user
Name | Type | Description |
---|---|---|
$userIDArray | \array(int) |


destroy(
string $sessionId
)
:
bool
Session destroy handler Callback: "destroy_[pre|post]" eZDB $db string $sessionId string $escKey
Name | Type | Description |
---|---|---|
$sessionId | string |
Type | Description |
---|---|
bool |


gc(
int $maxLifeTime
)
:
bool
Session gc (garbageCollector) handler Callback: "gc_[pre|post]" eZDB $db int $maxLifeTime
Name | Type | Description |
---|---|---|
$maxLifeTime | int | In seconds |
Type | Description |
---|---|
bool |


hasBackendAccess(
)
:
bool
Signals that handler has direct access to backend, thus is cable of supporting features like gc, cleanup, delete & count.
Type | Description |
---|---|
bool |


isConnected(
)
:
bool
Checks if session handler is connected with backend.
Type | Description |
---|---|
bool |


open(
string $savePath, string $sessionName
)
:
bool
Session open handler
Name | Type | Description |
---|---|---|
$savePath | string | |
$sessionName | string |
Type | Description |
---|---|
bool |


read(
string $sessionId
)
:
string | false
Session read handler
Name | Type | Description |
---|---|---|
$sessionId | string |
Type | Description |
---|---|
string | false | Binary session data |


regenerate(
bool $updateBackendData
=
true
)
:
bool
Regenerate session id Callback (when $updateBackendData is true): "regenerate_[pre|post]" eZDB $db string $escNewKey string $escOldKey int $escUserID
Name | Type | Description |
---|---|---|
$updateBackendData | bool | True if we want to keep session data with the new session id |
Type | Description |
---|---|
bool |