diff --git a/lib/Alchemy/Phrasea/Controller/Controller.php b/lib/Alchemy/Phrasea/Controller/Controller.php index 82b6c291e2..d0ad338f03 100644 --- a/lib/Alchemy/Phrasea/Controller/Controller.php +++ b/lib/Alchemy/Phrasea/Controller/Controller.php @@ -116,10 +116,12 @@ public function getAuthenticatedUser() public function setSessionFormToken($formName) { - $randomValue = bin2hex(random_bytes(35)); - $this->app['session']->set($formName.'_token', $randomValue); + if (!$this->app['session']->has($formName.'_token')) { + $randomValue = bin2hex(random_bytes(35)); + $this->app['session']->set($formName.'_token', $randomValue); - return $randomValue; + return $randomValue; + } } public function getSessionFormToken($formName)