lib/ezsession/classes/ezpsessionhandler.php
File containing abstract session handler
- Copyright
- Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.
- License
- eZ Proprietary Use License v1.0
- Package
- lib
- Version
- 4.5.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(
)
:
boolRemove all session data Callback: "cleanup_[pre|post]" eZDB $db
| Type | Description |
|---|---|
| bool |

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

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

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

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

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

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

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

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

regenerate(
bool $updateBackendData
=
true
)
:
boolRegenerate 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 |