Copied!

PHPFUI requires one session variable to validate requests for
a CSRF attach. The Session class wraps the details for the
library.

PHPFUI also provides basic flash support for subsequent requests in the same session.

Usage

\PHPFUI\Session::setFlash('error', 'That was nasty!');

Next request:

\PHPFUI\Session::cycleFlash();
$flash = \PHPFUI\Session::getflash('error');
if ($flash)
  {
  $callout = new \PHPFUI\Callout('alert');
  $callout->add($flash);
  }
Cloneable Instantiable
Constants
public PHPFUI\Session ::DEBUG_HTML = 1
public PHPFUI\Session ::DEBUG_JAVASCRIPT = 2
Methods
public static checkCSRF ( string $request = '' ) : bool
public static csrf ( string $quote = '' ) : string
public static csrfField () : string
public static cycleFlash () : void
 

Loads the flash from the previous page and removes it for the next

public static getFlash ( string $key = '' )
 

Return the flash for the key provided

public static setFlash ( string $key , $value = '' ) : void
 

Set a flash for the next request. You can sent multiple flashes by specifying different keys

public static setHandler ( PHPFUI\SessionHandler $handler ) : void
 

Set the session handler if you are not using the default

Properties
private static $flash
private static $handler
Methods
private static getHandler () : PHPFUI\SessionHandler
 

Get the current handler

Properties
private static $flash
private static $handler
Methods
public static checkCSRF ( string $request = '' ) : bool
public static csrf ( string $quote = '' ) : string
public static csrfField () : string
public static cycleFlash () : void
 

Loads the flash from the previous page and removes it for the next

public static getFlash ( string $key = '' )
 

Return the flash for the key provided

private static getHandler () : PHPFUI\SessionHandler
 

Get the current handler

public static setFlash ( string $key , $value = '' ) : void
 

Set a flash for the next request. You can sent multiple flashes by specifying different keys

public static setHandler ( PHPFUI\SessionHandler $handler ) : void
 

Set the session handler if you are not using the default

© 2020 Bruce Wells
Search Namespaces \ Classes
Configuration Numbers (0-9.) only