CSRF
  • Namespace
  • Class
  • Tree

Namespaces

  • PHP
  • Riimu
    • Kit
      • CSRF
        • Source
        • Storage

Classes

  • CookieStorage
  • SessionStorage

Interfaces

  • TokenStorage

Exceptions

  • TokenStorageException

Class SessionStorage

Stores the actual token in a session variable.

Riimu\Kit\CSRF\Storage\SessionStorage implements Riimu\Kit\CSRF\Storage\TokenStorage
Namespace: Riimu\Kit\CSRF\Storage
Copyright: Copyright (c) 2014, Riikka Kalliomäki
License: MIT License
Author: Riikka Kalliomäki riikka.kalliomaki@gmail.com
Located at Storage/SessionStorage.php

Methods summary

public
# __construct( string $name = 'csrf_token' )

Creates a new instance of SessionStorage.

Creates a new instance of SessionStorage.

Parameters

$name
Name of the session variable used to store the token
public
# storeToken( string $token )

Stores the CSRF token in the persistent storage.

Stores the CSRF token in the persistent storage.

Parameters

$token
The CSRF token to store

Throws

Riimu\Kit\CSRF\Storage\TokenStorageException
If the token cannot be successfully stored

Implementation of

Riimu\Kit\CSRF\Storage\TokenStorage::storeToken()
protected boolean
# isSessionActive( )

Tells if a session is currently active or not.

Tells if a session is currently active or not.

Returns

boolean
True if a session is active, false if not
public string|false
# getStoredToken( )

Loads the CSRF token from the persistent storage.

Loads the CSRF token from the persistent storage.

Returns

string|false
The stored token or false if none is stored

Throws

Riimu\Kit\CSRF\Storage\TokenStorageException
If the token cannot be successfully loaded

Implementation of

Riimu\Kit\CSRF\Storage\TokenStorage::getStoredToken()
CSRF API documentation generated by ApiGen