MemcachedSessionHandler
extends AbstractSessionHandler
in package
Memcached based session storage handler based on the Memcached class provided by the PHP memcached extension.
Tags
Table of Contents
Properties
- $igbinaryEmptyData : string
- $memcached : mixed
- $newSessionId : string|null
- $prefetchData : string
- $prefetchId : string
- $prefix : string
- Key prefix for shared environments.
- $sessionName : string
- $ttl : int|null
- Time to live in seconds.
Methods
- __construct() : mixed
- Constructor.
- close() : bool
- destroy() : bool
- gc() : int|false
- open() : bool
- read() : string
- updateTimestamp() : bool
- validateId() : bool
- write() : bool
- doDestroy() : bool
- doRead() : string
- doWrite() : bool
- getMemcached() : Memcached
- Return a Memcached instance.
- getCompatibleTtl() : int
Properties
$igbinaryEmptyData
private
string
$igbinaryEmptyData
$memcached
private
mixed
$memcached
$newSessionId
private
string|null
$newSessionId
= null
$prefetchData
private
string
$prefetchData
$prefetchId
private
string
$prefetchId
$prefix
Key prefix for shared environments.
private
string
$prefix
$sessionName
private
string
$sessionName
$ttl
Time to live in seconds.
private
int|null
$ttl
Methods
__construct()
Constructor.
public
__construct(Memcached $memcached[, array<string|int, mixed> $options = [] ]) : mixed
List of available options:
- prefix: The prefix to use for the memcached keys in order to avoid collision
- ttl: The time to live in seconds.
Parameters
- $memcached : Memcached
- $options : array<string|int, mixed> = []
Tags
close()
public
close() : bool
Return values
booldestroy()
public
destroy(string $sessionId) : bool
Parameters
- $sessionId : string
Return values
boolgc()
public
gc(int $maxlifetime) : int|false
Parameters
- $maxlifetime : int
Return values
int|falseopen()
public
open(string $savePath, string $sessionName) : bool
Parameters
- $savePath : string
- $sessionName : string
Return values
boolread()
public
read(string $sessionId) : string
Parameters
- $sessionId : string
Return values
stringupdateTimestamp()
public
updateTimestamp(string $sessionId, string $data) : bool
Parameters
- $sessionId : string
- $data : string
Return values
boolvalidateId()
public
validateId(string $sessionId) : bool
Parameters
- $sessionId : string
Return values
boolwrite()
public
write(string $sessionId, string $data) : bool
Parameters
- $sessionId : string
- $data : string
Return values
booldoDestroy()
protected
doDestroy(string $sessionId) : bool
Parameters
- $sessionId : string
Return values
booldoRead()
protected
doRead(string $sessionId) : string
Parameters
- $sessionId : string
Return values
stringdoWrite()
protected
doWrite(string $sessionId, string $data) : bool
Parameters
- $sessionId : string
- $data : string
Return values
boolgetMemcached()
Return a Memcached instance.
protected
getMemcached() : Memcached
Return values
MemcachedgetCompatibleTtl()
private
getCompatibleTtl() : int