class RedisSessionHandler extends SessionHandler (View source)

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

Properties

private $redis
private string $prefix

Methods

__construct(Redis|RedisArray|RedisCluster|Client $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.

doRead($sessionId)

No description

read($session_id)

{@inheritdoc}

doWrite($sessionId, $data)

No description

write($session_id, $session_data)

{@inheritdoc}

destroy($session_id)

{@inheritdoc}

doDestroy($sessionId)

No description

close()

{@inheritdoc}

gc($maxlifetime)

{@inheritdoc}

updateTimestamp($sessionId, $data)

No description

Details

__construct(Redis|RedisArray|RedisCluster|Client $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 $redis
array $options

An associative array of options

Exceptions

InvalidArgumentException

protected doRead($sessionId)

No description

Parameters

$sessionId

read($session_id)

{@inheritdoc}

Parameters

$session_id

See also

\SessionHandler::read()

protected doWrite($sessionId, $data)

No description

Parameters

$sessionId
$data

write($session_id, $session_data)

{@inheritdoc}

Parameters

$session_id
$session_data

See also

\SessionHandler::write()

destroy($session_id)

{@inheritdoc}

Parameters

$session_id

See also

\SessionHandler::destroy()

protected doDestroy($sessionId)

No description

Parameters

$sessionId

close()

{@inheritdoc}

See also

\SessionHandler::close()

gc($maxlifetime)

{@inheritdoc}

Parameters

$maxlifetime

See also

\SessionHandler::gc()

updateTimestamp($sessionId, $data)

No description

Parameters

$sessionId
$data