See /~https://github.com/slimphp/Slim-Csrf/releases for a full list
- Added: Support for PHP 8.2 and 8.3
- Added: Support for psr/http-message 2.0 in addition to 1.0
- Added: Allow to set token name and value in header
- Added: Support for PSR-12
- Added: Add XOR to token to avoid BREACH attack
- Change: PHP 7.3 is no longer supported
- Added: Implement iterator support for getLastKeyPair
- Added: Support PHP 8
- Changed: Remove support for PHP 7.1 and 7.2
- Changed:
remoteTokenFromStorage()
is now public - Changed: Don't allow token in the body of a GET request
- Fixed: Prevent replay attack by removing token on valdiation
- Added: PSR-15 support
- Fixed: Widen random_compat constraint in composer.json
- Fixed: Attach token name and value to request when persist mode is on
- Fixed: Default stroageis now $_SESSION again
-
Added: 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
andgetTokenValue
now returnnull
if$this->keyPair
has not yet been set.