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

Namespaces

  • AloFramework
    • Session
  • PHP

Classes

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

Exceptions

  • SessionException

Class Token

CSRF token management

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

Methods summary

public
# __construct( string $name, AloFramework\Session\AbstractSession|AloFramework\Session\Config $cfg = null )

Constructor

Constructor

Parameters

$name
Token name/ID
$cfg

The instance of the currently active session. If omitted, AbstractSession::getLastActiveSession() will be used

Throws

InvalidArgumentException
if $cfg isn't an instance of Config or AbstractSession

Author

Art a.molcanovas@gmail.com
public string|null
# get( )

Returns a previously generated token

Returns a previously generated token

Returns

string|null

Author

Art a.molcanovas@gmail.com
public string|null
# create( string $hash = 'sha256' )

Creates and returns a token

Creates and returns a token

Parameters

$hash
Hash algorithm to use for the token

Returns

string|null

Author

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

Removes all the stored tokens

Removes all the stored tokens

Returns

boolean

Author

Art a.molcanovas@gmail.com
public mixed|null
# getAndRemove( )

Gets a token and removes it from the session

Gets a token and removes it from the session

Returns

mixed|null
The token

Author

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

Removes a token

Removes a token

Returns

boolean

Author

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

Returns the token name

Returns the token name

Returns

string

Author

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

Returns the token key

Returns the token key

Returns

string

Author

Art a.molcanovas@gmail.com
AloFramework Sessions 1.2 API API documentation generated by ApiGen