W3cubDocs

/Symfony 4.1

RedisSessionHandler

class RedisSessionHandler extends AbstractSessionHandler

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

Methods

open($savePath, $sessionName)

{@inheritdoc}

from AbstractSessionHandler
string doRead(string $sessionId)
bool doWrite(string $sessionId, string $data)
bool doDestroy(string $sessionId)
validateId($sessionId)

{@inheritdoc}

from AbstractSessionHandler
read($sessionId)

{@inheritdoc}

from AbstractSessionHandler
write($sessionId, $data)

{@inheritdoc}

from AbstractSessionHandler
destroy($sessionId)

{@inheritdoc}

from AbstractSessionHandler
__construct(Redis|RedisArray|RedisCluster|Client|RedisProxy $redis, array $options = array())

List of available options: * prefix: The prefix to use for the keys in order to avoid collision on the Redis server.

bool close()

{@inheritdoc}

bool gc($maxlifetime)

{@inheritdoc}

updateTimestamp($sessionId, $data)

{@inheritdoc}

Details

open($savePath, $sessionName)

{@inheritdoc}

Parameters

$savePath
$sessionName

protected string doRead(string $sessionId)

Parameters

string $sessionId

Return Value

string

protected bool doWrite(string $sessionId, string $data)

Parameters

string $sessionId
string $data

Return Value

bool

protected bool doDestroy(string $sessionId)

Parameters

string $sessionId

Return Value

bool

validateId($sessionId)

{@inheritdoc}

Parameters

$sessionId

read($sessionId)

{@inheritdoc}

Parameters

$sessionId

write($sessionId, $data)

{@inheritdoc}

Parameters

$sessionId
$data

destroy($sessionId)

{@inheritdoc}

Parameters

$sessionId

__construct(Redis|RedisArray|RedisCluster|Client|RedisProxy $redis, array $options = array())

List of available options: * prefix: The prefix to use for the keys in order to avoid collision on the Redis server.

Parameters

Redis|RedisArray|RedisCluster|Client|RedisProxy $redis
array $options An associative array of options

Exceptions

InvalidArgumentException When unsupported client or options are passed

bool close()

{@inheritdoc}

Return Value

bool

bool gc($maxlifetime)

{@inheritdoc}

Parameters

$maxlifetime

Return Value

bool

updateTimestamp($sessionId, $data)

{@inheritdoc}

Parameters

$sessionId
$data