csrf Class Reference

CSRF helper class. More...

Static Public Member Functions

static token ($force=false)
 Generate new token Save token to session together with time for generation.
static current_token_expired ()
 Checks if current token has expired.
static valid ($token)
 Validate token.
static current_token ()
 Return current csrf token.
static current_timestamp ()
 Return current csrf timestamp.
static lifetime ()
 Return lifetime for current csrf token.
static form_field ($name='')
 Return a string representation of a form element with the current CSRF token.

Detailed Description

CSRF helper class.


Member Function Documentation

static csrf::current_token_expired (  )  [static]

Checks if current token has expired.

Returns:
boolean
static csrf::form_field ( name = ''  )  [static]

Return a string representation of a form element with the current CSRF token.

Parameters:
$name The name of the form element
static csrf::token ( force = false  )  [static]

Generate new token Save token to session together with time for generation.

Returns:
str $token
static csrf::valid ( token  )  [static]

Validate token.

Parameters:
$token The csrf token
Returns:
true if validation was successful, false otherwise

The documentation for this class was generated from the following file:
 All Data Structures Functions Variables

Generated on 30 Oct 2014 for ninja by  doxygen 1.6.1