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

Namespaces

  • AloFramework
    • Session
  • PHP

Classes

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

Exceptions

  • SessionException

Class MySQLSession

MySQL-based session handler

AloFramework\Session\AbstractSession implements SessionHandlerInterface, AloFramework\Config\Configurable, ArrayAccess uses AloFramework\Config\ConfigurableTrait (not available)
Extended by AloFramework\Session\MySQLSession

Direct known subclasses

AloFramework\Session\MySQLNoEventSession

Namespace: AloFramework\Session
Author: Art a.molcanovas@gmail.com
Located at MySQLSession.php

Methods summary

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

Constructor

Constructor

Parameters

$pdo
PDO instance to use
$cfg
Your custom configuration
$logger
A logger object. If omitted, AloFramework\Log will be used.

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

Throws

AloFramework\Session\SessionException
On PDOException or general query failure

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 PDO $client

The PDO instance

The PDO instance

#

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