PHP Classes

File: libraries/vendor/slim/csrf/CHANGELOG.md

Recommend this page to a friend!
  Classes of Duong Huynh Nghia   PHP Slim Framework 3 Modular Application   libraries/vendor/slim/csrf/CHANGELOG.md   Download  
File: libraries/vendor/slim/csrf/CHANGELOG.md
Role: Auxiliary data
Content type: text/markdown
Description: Auxiliary data
Class: PHP Slim Framework 3 Modular Application
Create modular applications using Slim Framework
Author: By
Last change:
Date: 7 years ago
Size: 1,390 bytes
 

Contents

Class file image Download

Change Log

2016-08-14

Now supports "persistence mode", to persist a single CSRF name/value pair throughout the life of a user's session. Added the following methods:

  • `protected getLastKeyPair` - gets the most recently generated key/value pair from storage.
  • `protected loadLastKeyPair` - gets the most recently generated key/value pair from storage, and assign it to `$this->keyPair`.
  • `public setPersistentTokenMode`
  • `public getPersistentTokenMode`

Note that if CSRF token validation fails, then the token should be renewed regardless of the persistence setting.

The methods getTokenName and getTokenValue now return null if $this->keyPair has not yet been set.

Tests added:

  • `testPersistenceModeTrueBetweenRequestsArray` - Token should persist between requests after initial creation, when stored in an array.
  • `testPersistenceModeTrueBetweenRequestsArrayAccess` - Token should persist between requests after initial creation, when stored in an ArrayObject.
  • `testPersistenceModeFalseBetweenRequestsArray` - Token should be changed between requests, when stored in an array.
  • `testPersistenceModeFalseBetweenRequestsArrayAccess` - Token should be changed between requests, when stored in an ArrayObject.
  • `testUpdateAfterInvalidTokenWithPersistenceModeTrue` - New token should be generated after an invalid request, even if persistence mode is enabled.