Documentation

RdbSessionHandler
in package
implements SessionHandlerInterface

A session handler for Rdb.

Session handling can be registered using the Rdb::registerSessionHandler method.

The php-redis adapter and credis (in non-standalone mode) offer an optional 'native' handler via the options.use_native_session flag. This may offer more performance.

Table of Contents

Interfaces

SessionHandlerInterface

Properties

$prefix  : string
$rdb  : Rdb
$ttl  : int

Methods

__construct()  : mixed
close()  : bool
destroy()  : bool
gc()  : int
open()  : bool
read()  : string|false
write()  : bool

Properties

Methods

__construct()

public __construct(Rdb $rdb[, array<string|int, mixed> $options = [] ]) : mixed
Parameters
$rdb : Rdb
$options : array<string|int, mixed> = []

[ ttl, prefix ]

  • ttl: seconds
  • prefix: default 'session:'

destroy()

public destroy(string $session_id) : bool
Parameters
$session_id : string
Tags
inheritdoc
Return values
bool

gc()

public gc(int $maxlifetime) : int
Parameters
$maxlifetime : int
Tags
inheritdoc
Return values
int

open()

public open(string $save_path, string $session_id) : bool
Parameters
$save_path : string
$session_id : string
Tags
inheritdoc
Return values
bool

read()

public read(string $session_id) : string|false
Parameters
$session_id : string
Tags
inheritdoc
Return values
string|false

write()

public write(string $session_id, string $session_data) : bool
Parameters
$session_id : string
$session_data : string
Tags
inheritdoc
Return values
bool
On this page

Search results