From 3c52a3bcca6e3723da833f243af6651ec55cddcc Mon Sep 17 00:00:00 2001 From: Juan Cristobal <65052633+juancristobalgd1@users.noreply.github.com> Date: Thu, 4 Jan 2024 16:49:45 +0100 Subject: [PATCH] update file --- src/Application.php | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/src/Application.php b/src/Application.php index 0c95c4d..8b117ee 100644 --- a/src/Application.php +++ b/src/Application.php @@ -285,36 +285,6 @@ private function generateAndSetCsrfToken(): string return $csrfToken; } - - /** - * Generate a CSRF token. - * - * This method generates a CSRF token and stores it in a cookie. - * If a token already exists in the cookie, it is reused. - * @return string The generated or existing CSRF token. - */ - public function generateCsrfToken(): string - { - if (empty($_COOKIE['csrfToken'])) { - $csrfToken = $this->generateTokens(); - setcookie('csrfToken', $csrfToken, time() + 60 * config('session.expiration')); // Set the cookie to expire in 24 hours - return $csrfToken; - } - - return $_COOKIE['csrfToken']; - } - - /** - * Get the CSRF token. - * - * This method retrieves the CSRF token from the cookie, or generates a new one if not available. - * @return string The CSRF token. - */ - public function getCsrfToken(): string - { - return $this->generateCsrfToken(); - } - /** * Check if the provided CSRF token matches the one in the session. *