diff --git a/includes/functions.php b/includes/functions.php index d97108d1..055f750e 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -59,7 +59,9 @@ function safefilerewrite($fileName, $dataToSave) */ function ensureCSRFSessionToken() { - $_SESSION['csrf_token'] = bin2hex(random_bytes(32)); + if (empty($_SESSION['csrf_token'])) { + $_SESSION['csrf_token'] = bin2hex(random_bytes(32)); + } } /**