AloFramework documentation
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo
  • Download

Namespaces

  • Alo
    • Cache
    • Controller
    • Db
    • Exception
    • Session
    • Statics
    • Test
    • Validators
  • Controller
  • None
  • PHP

Classes

  • AbstractSession
  • MemcachedSession
  • SQLSession

Class AbstractSession

The session interface

Direct known subclasses

Alo\Session\MemcachedSession, Alo\Session\SQLSession

Abstract
Namespace: Alo\Session
Package: Session
Author: Art <a.molcanovas@gmail.com>
Located at sys/class/alo/session/abstractsession.php

Methods summary

public
# __construct( )

Instantiates the class

Instantiates the class

Author

Art <a.molcanovas@gmail.com>
abstract protected Alo\Session\AbstractSession
# write( )

Saves session data

Saves session data

Returns

Alo\Session\AbstractSession

Author

Art <a.molcanovas@gmail.com>
protected Alo\Session\SQLSession
# setID( )

Sets the session ID variable & the cookie

Sets the session ID variable & the cookie

Returns

Alo\Session\SQLSession

Author

Art <a.molcanovas@gmail.com>
abstract protected Alo\Session\AbstractSession
# fetch( )

Fetches session data

Fetches session data

Returns

Alo\Session\AbstractSession

Author

Art <a.molcanovas@gmail.com>
protected Alo\Session\SQLSession
# removeExpired( )

Removes expired session keys

Removes expired session keys

Returns

Alo\Session\SQLSession

Author

Art <a.molcanovas@gmail.com>
protected boolean
# identityCheck( )

Checks if the session hasn't been hijacked

Checks if the session hasn't been hijacked

Returns

boolean
TRUE if the check has passed, FALSE if not and the session has been terminated.

Author

Art <a.molcanovas@gmail.com>
public boolean
# refreshToken( )

Refreshes the user's session token. This will have no effect unless you overwrite the token during runtime.

Refreshes the user's session token. This will have no effect unless you overwrite the token during runtime.

Returns

boolean
Whether the user passes the identity check after the token refresh. The session is terminated if the identity check fails.

Author

Art <a.molcanovas@gmail.com>
protected static string
# getToken( )

Generates a session token

Generates a session token

Returns

string

Author

Art <a.molcanovas@gmail.com>
public string
# getTokenExpected( )

Returns the expected session token

Returns the expected session token

Returns

string

Author

Art <a.molcanovas@gmail.com>
public string|null
# getTokenActual( )

Returns the actual session token

Returns the actual session token

Returns

string|null

Author

Art <a.molcanovas@gmail.com>
public Alo\Session\AbstractSession
# clear( )

Clears all session variables except for the token

Clears all session variables except for the token

Returns

Alo\Session\AbstractSession

Author

Art <a.molcanovas@gmail.com>
public mixed
# __get( string $key )

Gets a session value

Gets a session value

Parameters

$key
string
$key The identifier

Returns

mixed

Author

Art <a.molcanovas@gmail.com>
public Alo\Session\AbstractSession
# forceWrite( )

Force-calls the write method

Force-calls the write method

Returns

Alo\Session\AbstractSession

Author

Art <a.molcanovas@gmail.com>

See

Alo\Session\AbstractSession::write()
public
# __set( string $key, mixed $val )

Sets a session value

Sets a session value

Parameters

$key
string
$key The identifier
$val
mixed
$val The value

Author

Art <a.molcanovas@gmail.com>
public
# __unset( string $key )

Unsets a session key

Unsets a session key

Parameters

$key
string
$key The session value's key

Author

Art <a.molcanovas@gmail.com>
public boolean
# __isset( string $key )

Checks if a session key is set

Checks if a session key is set

Parameters

$key
string
$key The key

Returns

boolean

Author

Art <a.molcanovas@gmail.com>
public string
# __toString( )

Returns a string representation of the session data

Returns a string representation of the session data

Returns

string

Author

Art <a.molcanovas@gmail.com>
public Alo\Session\AbstractSession
# delete( string|array $key )

Deletes a session value

Deletes a session value

Parameters

$key
string|array
$key The corresponding key or array of keys

Returns

Alo\Session\AbstractSession

Author

Art <a.molcanovas@gmail.com>
public array
# getAll( )

Returns all session data in an associative array

Returns all session data in an associative array

Returns

array

Author

Art <a.molcanovas@gmail.com>
public string
# getID( )

Returns the session ID

Returns the session ID

Returns

string

Author

Art <a.molcanovas@gmail.com>
public Alo\Session\AbstractSession
# expire( string $key, integer $time )

Sets a session key to expire

Sets a session key to expire

Parameters

$key
string
$key The key
$time
integer
$time Expiration time in seconds

Returns

Alo\Session\AbstractSession

Author

Art <a.molcanovas@gmail.com>
public Alo\Session\AbstractSession
# terminate( )

Terminates the session

Terminates the session

Returns

Alo\Session\AbstractSession

Author

Art <a.molcanovas@gmail.com>
public
# __destruct( )

Saves session data if $this->save hasn't been changed to false

Saves session data if $this->save hasn't been changed to false

Author

Art <a.molcanovas@gmail.com>

Magic methods summary

Constants summary

string HASH_ALGO 'sha512'
#

Hash algorithm in use

Hash algorithm in use

string EXPIRE_KEY '__expire'
#

Session key under which key expiration data is stored

Session key under which key expiration data is stored

Properties summary

protected array $data
#

The data array

The data array

protected boolean $save
#

Whether to save session data

Whether to save session data

protected integer $time
#

Value of time()

Value of time()

protected string $id
#

The session ID

The session ID

AloFramework documentation API documentation generated by ApiGen 2.8.0