RedisSessionHandler
extends AbstractSessionHandler
in package
Redis based session storage handler based on the Redis class provided by the PHP redis extension.
Tags
Table of Contents
Properties
- $igbinaryEmptyData : string
- $newSessionId : string|null
- $prefetchData : string
- $prefetchId : string
- $prefix : string
- Key prefix for shared environments.
- $redis : mixed
- $sessionName : string
- $ttl : int|null
- Time to live in seconds.
Methods
- __construct() : mixed
- List of available options: * prefix: The prefix to use for the keys in order to avoid collision on the Redis server * ttl: The time to live in seconds.
- close() : bool
- {@inheritdoc}
- destroy() : bool
- gc() : int|false
- open() : bool
- read() : string
- updateTimestamp() : bool
- validateId() : bool
- write() : bool
- doDestroy() : bool
- doRead() : string
- doWrite() : bool
Properties
$igbinaryEmptyData
private
string
$igbinaryEmptyData
$newSessionId
private
string|null
$newSessionId
= null
$prefetchData
private
string
$prefetchData
$prefetchId
private
string
$prefetchId
$prefix
Key prefix for shared environments.
private
string
$prefix
$redis
private
mixed
$redis
$sessionName
private
string
$sessionName
$ttl
Time to live in seconds.
private
int|null
$ttl
Methods
__construct()
List of available options: * prefix: The prefix to use for the keys in order to avoid collision on the Redis server * ttl: The time to live in seconds.
public
__construct(Redis|RedisArray|RedisCluster|ClientInterface|RedisProxy|RedisClusterProxy $redis[, array<string|int, mixed> $options = [] ]) : mixed
Parameters
- $redis : Redis|RedisArray|RedisCluster|ClientInterface|RedisProxy|RedisClusterProxy
- $options : array<string|int, mixed> = []
Tags
close()
{@inheritdoc}
public
close() : bool
Return values
booldestroy()
public
destroy(string $sessionId) : bool
Parameters
- $sessionId : string
Return values
boolgc()
public
gc(int $maxlifetime) : int|false
Parameters
- $maxlifetime : int
Return values
int|falseopen()
public
open(string $savePath, string $sessionName) : bool
Parameters
- $savePath : string
- $sessionName : string
Return values
boolread()
public
read(string $sessionId) : string
Parameters
- $sessionId : string
Return values
stringupdateTimestamp()
public
updateTimestamp(string $sessionId, string $data) : bool
Parameters
- $sessionId : string
- $data : string
Return values
boolvalidateId()
public
validateId(string $sessionId) : bool
Parameters
- $sessionId : string
Return values
boolwrite()
public
write(string $sessionId, string $data) : bool
Parameters
- $sessionId : string
- $data : string
Return values
booldoDestroy()
protected
doDestroy(string $sessionId) : bool
Parameters
- $sessionId : string
Return values
booldoRead()
protected
doRead(string $sessionId) : string
Parameters
- $sessionId : string
Return values
stringdoWrite()
protected
doWrite(string $sessionId, string $data) : bool
Parameters
- $sessionId : string
- $data : string