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

Namespaces

  • AloFramework
    • Session
  • PHP

Classes

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

Exceptions

  • SessionException

Class AbstractSession

Abstract session operations

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

Direct known subclasses

AloFramework\Session\MySQLSession, AloFramework\Session\RedisSession

Indirect known subclasses

AloFramework\Session\MySQLNoEventSession

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

Methods summary

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

Constructor

Constructor

Parameters

$cfg
Your custom configuration
$logger
A logger object. If omitted, AloFramework\Log will be used.

Author

Art a.molcanovas@gmail.com
protected string
# setID( )

Sets the session ID variable & the cookie

Sets the session ID variable & the cookie

Returns

string
The generated ID

Author

Art a.molcanovas@gmail.com
abstract 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 static boolean
# destroySafely( )

Only calls session_destroy() if a session is active

Only calls session_destroy() if a session is active

Returns

boolean

Author

Art a.molcanovas@gmail.com
public static boolean
# isActive( )

Checks whether a session is currently active

Checks whether a session is currently active

Returns

boolean

Author

Art a.molcanovas@gmail.com
public static AloFramework\Session\AbstractSession
# getLastActiveSession( )

Returns the last started session object. This is reset back to null after the session is destroyed or closed.

Returns the last started session object. This is reset back to null after the session is destroyed or closed.

Returns

AloFramework\Session\AbstractSession

Author

Art a.molcanovas@gmail.com

Since

1.2
public AloFramework\Session\AbstractSession
# start( )

Starts the session

Starts the session

Returns

AloFramework\Session\AbstractSession

Author

Art a.molcanovas@gmail.com
protected
# handleIdentityCheckFailure( string $sessionID )

What to do when an identity check fails

What to do when an identity check fails

Parameters

$sessionID
The session ID that failed

Author

Art a.molcanovas@gmail.com
public boolean
# close( )

Close the session

Close the session

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.close.php

Codecoverageignore

Implementation of

SessionHandlerInterface::close()
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

Implementation of

SessionHandlerInterface::destroy()
public boolean
# gc( integer $maxlifetime )

Cleanup old sessions.

Cleanup old sessions.

Parameters

$maxlifetime
Sessions that have not updated for the last maxlifetime seconds will be removed.

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.gc.php

Codecoverageignore

Implementation of

SessionHandlerInterface::gc()
public boolean
# open( string $savePath, string $sessionID )

Initialize session

Initialize session

Parameters

$savePath
The path where to store/retrieve the session.
$sessionID
The session id.

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.open.php

Codecoverageignore

Implementation of

SessionHandlerInterface::open()
public boolean
# offsetExists( string $offset )

Whether a offset exists

Whether a offset exists

Parameters

$offset
The key

Returns

boolean

Author

Art a.molcanovas@gmail.com

Link

http://php.net/manual/en/arrayaccess.offsetexists.php

Implementation of

ArrayAccess::offsetExists()
public mixed
# __get( string $key )

Magic getter

Magic getter

Parameters

$key
The key to get

Returns

mixed

Author

Art a.molcanovas@gmail.com

Uses

AloFramework\Session\AbstractSession::offsetGet()
public
# __set( string $key, mixed $value )

Magic setter

Magic setter

Parameters

$key
Key to set
$value
Value to set

Author

Art a.molcanovas@gmail.com

Uses

AloFramework\Session\AbstractSession::offsetSet()
public mixed
# offsetGet( string $offset )

Offset to retrieve

Offset to retrieve

Parameters

$offset
The key

Returns

mixed

Author

Art a.molcanovas@gmail.com

Used by

AloFramework\Session\AbstractSession::__get()

Link

http://php.net/manual/en/arrayaccess.offsetget.php

Implementation of

ArrayAccess::offsetGet()
public
# offsetSet( string $offset, mixed $value )

Offset to set

Offset to set

Parameters

$offset
The key
$value
Value to set

Author

Art a.molcanovas@gmail.com

Used by

AloFramework\Session\AbstractSession::__set()

Link

http://php.net/manual/en/arrayaccess.offsetset.php

Implementation of

ArrayAccess::offsetSet()
public
# offsetUnset( string $offset )

Offset to unset

Offset to unset

Parameters

$offset
The key

Author

Art a.molcanovas@gmail.com

Link

http://php.net/manual/en/arrayaccess.offsetunset.php

Implementation of

ArrayAccess::offsetUnset()
public
# __destruct( )

Saves session data

Saves session data

Author

Art a.molcanovas@gmail.com
protected boolean
# shouldBeSaved( )

Checks if the session should be saved/written

Checks if the session should be saved/written

Returns

boolean

Author

Art a.molcanovas@gmail.com

Since

1.1

Methods inherited from SessionHandlerInterface

read(), write()

Properties summary

protected Psr\Log\LoggerInterface $log

Logger instance

Logger instance

#

Magic properties

public AloFramework\Session\Config $config
AloFramework Sessions 1.2 API API documentation generated by ApiGen