diff --git a/CHANGELOG.md b/CHANGELOG.md index 5413163..7ff596d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ See https://github.com/slimphp/Slim-Csrf/releases for a full list underscore. This should not affect anyone who uses the relvant methods, but if you have hard-coded, then they will need to be updated. +- Changed: Increased likelihood that tokens are unique. + ## 1.5.0 - Added: Support for PHP 8.2 and 8.3 diff --git a/src/Guard.php b/src/Guard.php index 681ff91..cee97fb 100644 --- a/src/Guard.php +++ b/src/Guard.php @@ -215,7 +215,7 @@ protected function createToken(): string public function generateToken(): array { // Generate new CSRF token - $name = uniqid($this->prefix); + $name = uniqid($this->prefix, true); $value = $this->createToken(); $this->saveTokenToStorage($name, $value);