Class RedisSession
Redis-based session handler
-
AloFramework\Session\AbstractSession
implements
SessionHandlerInterface,
AloFramework\Config\Configurable,
ArrayAccess
uses
AloFramework\Config\ConfigurableTrait (not available)
-
AloFramework\Session\RedisSession
Methods summary
public
|
#
__construct( Redis $redis = null, AloFramework\Session\Config $cfg = null, Psr\Log\LoggerInterface $logger = null )
Constructor
Parameters
- $redis
The Redis instance with an active connection. If omitted, a new one will be
created and an attempt to connect to localhost with default settings will
be made.
- $cfg
- Your custom configuration
- $logger
- A logger object. If omitted, AloFramework\Log will be used.
Throws
Author
Overrides
|
public
boolean
|
#
destroy( string $sessionID )
Destroy a session
Parameters
- $sessionID
- The session ID being destroyed.
Returns
boolean The return value (usually TRUE on success, FALSE on failure). Note this value is returned
internally to PHP for processing.
Author
Link
Overrides
|
protected
boolean
|
#
idExists( string $sessionID )
Check if the given session ID exists
Check if the given session ID exists
Parameters
- $sessionID
- The session ID
Returns
boolean
Author
|
public
string
|
#
read( string $sessionID )
Read session data
Parameters
- $sessionID
- The session id to read data for.
Returns
string Returns an encoded string of the read data. If nothing was read, it must return an empty
string. Note this value is returned internally to PHP for processing.
Author
Link
|
public
boolean
|
#
write( string $sessionID, string $sessionData )
Write session data
Parameters
- $sessionID
- The session id.
- $sessionData
The encoded session data. This data is the result of the PHP internally
encoding the $_SESSION superglobal to a serialized string and passing it as
this parameter. Please note sessions use an alternative serialization method.
Returns
boolean The return value (usually TRUE on success, FALSE on failure). Note this value is returned
internally to PHP for processing.
Author
Link
|
__destruct()
,
__get()
,
__set()
,
close()
,
destroySafely()
,
gc()
,
getLastActiveSession()
,
handleIdentityCheckFailure()
,
isActive()
,
offsetExists()
,
offsetGet()
,
offsetSet()
,
offsetUnset()
,
open()
,
setID()
,
shouldBeSaved()
,
start()