Documentation

RedisSessionHandler extends AbstractSessionHandler
in package

Redis based session storage handler based on the Redis class provided by the PHP redis extension.

Tags
author

Dalibor Karlović dalibor@flexolabs.io

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

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
throws
InvalidArgumentException

When unsupported client or options are passed

destroy()

public destroy(string $sessionId) : bool
Parameters
$sessionId : string
Return values
bool

gc()

public gc(int $maxlifetime) : int|false
Parameters
$maxlifetime : int
Return values
int|false

open()

public open(string $savePath, string $sessionName) : bool
Parameters
$savePath : string
$sessionName : string
Return values
bool

read()

public read(string $sessionId) : string
Parameters
$sessionId : string
Return values
string

updateTimestamp()

public updateTimestamp(string $sessionId, string $data) : bool
Parameters
$sessionId : string
$data : string
Return values
bool

validateId()

public validateId(string $sessionId) : bool
Parameters
$sessionId : string
Return values
bool

write()

public write(string $sessionId, string $data) : bool
Parameters
$sessionId : string
$data : string
Return values
bool

doDestroy()

protected doDestroy(string $sessionId) : bool
Parameters
$sessionId : string
Return values
bool

doRead()

protected doRead(string $sessionId) : string
Parameters
$sessionId : string
Return values
string

doWrite()

protected doWrite(string $sessionId, string $data) : bool
Parameters
$sessionId : string
$data : string
Return values
bool

        
On this page

Search results