Session
+ Inheritance diagram for Session:

Description

The session.

Protected Properties

Site $site
 

Public Methods

 __construct (Site $site)
 Starts the session and initializes the CSRF token. More...
 
string getToken ()
 
mixed getUser ()
 Returns the stored user, or null. More...
 
void logout ()
 Wipes the session. More...
 
bool offsetExists ($offset)
 
mixed offsetGet ($offset)
 
void offsetSet ($offset, $value)
 
void offsetUnset ($offset)
 
$this setUser ($user)
 Sets the user (logs them in). More...
 
$this verify ($token)
 Checks the given CSRF token against what we expect. More...
 

Constructor

◆ __construct()

__construct ( Site  $site)

Starts the session and initializes the CSRF token.

Parameters
Site$site

Methods

◆ getToken()

string getToken ( )
Returns
string

◆ getUser()

mixed getUser ( )

Returns the stored user, or null.

Returns
mixed

◆ logout()

void logout ( )

Wipes the session.

◆ offsetExists()

bool offsetExists (   $offset)
Parameters
mixed$offset
Returns
bool

◆ offsetGet()

mixed offsetGet (   $offset)
Parameters
mixed$offset
Returns
mixed Coalesces to null

◆ offsetSet()

void offsetSet (   $offset,
  $value 
)
Parameters
mixed$offset
mixed$value

◆ offsetUnset()

void offsetUnset (   $offset)
Parameters
mixed$offset

◆ setUser()

$this setUser (   $user)

Sets the user (logs them in).

Parameters
mixed$user
Returns
$this

◆ verify()

$this verify (   $token)

Checks the given CSRF token against what we expect.

If they don't match, a 403 is logged and thrown.

Parameters
$token
Returns
$this
Exceptions
HttpError