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
Methods
- __construct() : mixed
- close() : bool
- destroy() : bool
- gc() : int
- open() : bool
- read() : string|false
- write() : bool
Properties
$prefix
protected
string
$prefix
$rdb
protected
Rdb
$rdb
$ttl
protected
int
$ttl
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:'
close()
public
close() : bool
Tags
Return values
booldestroy()
public
destroy(string $session_id) : bool
Parameters
- $session_id : string
Tags
Return values
boolgc()
public
gc(int $maxlifetime) : int
Parameters
- $maxlifetime : int
Tags
Return values
intopen()
public
open(string $save_path, string $session_id) : bool
Parameters
- $save_path : string
- $session_id : string
Tags
Return values
boolread()
public
read(string $session_id) : string|false
Parameters
- $session_id : string
Tags
Return values
string|falsewrite()
public
write(string $session_id, string $session_data) : bool
Parameters
- $session_id : string
- $session_data : string