AloFramework Sessions 1.2 API
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo

Namespaces

  • AloFramework
    • Session
  • PHP

Classes

  • AbstractSession
  • Config
  • MySQLNoEventSession
  • MySQLSession
  • RedisSession
  • Token

Exceptions

  • SessionException

Class RedisSession

Redis-based session handler

AloFramework\Session\AbstractSession implements SessionHandlerInterface, AloFramework\Config\Configurable, ArrayAccess uses AloFramework\Config\ConfigurableTrait (not available)
Extended by AloFramework\Session\RedisSession
Namespace: AloFramework\Session
Author: Art a.molcanovas@gmail.com
Located at RedisSession.php

Methods summary

public
# __construct( Redis $redis = null, AloFramework\Session\Config $cfg = null, Psr\Log\LoggerInterface $logger = null )

Constructor

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

AloFramework\Session\SessionException
When $redis isn't supplied and we're unable to connect to localhost.

Author

Art a.molcanovas@gmail.com

Overrides

AloFramework\Session\AbstractSession::__construct
public boolean
# destroy( string $sessionID )

Destroy a session

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

Art a.molcanovas@gmail.com

Link

http://php.net/manual/en/sessionhandlerinterface.destroy.php

Overrides

AloFramework\Session\AbstractSession::destroy
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

Art a.molcanovas@gmail.com
public string
# read( string $sessionID )

Read session data

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

Art a.molcanovas@gmail.com

Link

http://php.net/manual/en/sessionhandlerinterface.read.php
public boolean
# write( string $sessionID, string $sessionData )

Write session data

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

Art a.molcanovas@gmail.com

Link

http://php.net/manual/en/sessionhandlerinterface.write.php

Methods inherited from AloFramework\Session\AbstractSession

__destruct(), __get(), __set(), close(), destroySafely(), gc(), getLastActiveSession(), handleIdentityCheckFailure(), isActive(), offsetExists(), offsetGet(), offsetSet(), offsetUnset(), open(), setID(), shouldBeSaved(), start()

Properties summary

protected Redis $client

The Redis client

The Redis client

#

Properties inherited from AloFramework\Session\AbstractSession

$log

Magic properties inherited from AloFramework\Session\AbstractSession

$config

AloFramework Sessions 1.2 API API documentation generated by ApiGen