What are the potential issues with saving cookies after upgrading to PHP 8.0.2?

After upgrading to PHP 8.0.2, one potential issue with saving cookies is that the setcookie() function now requires the SameSite attribute to be explicitly set to prevent cross-site request forgery attacks. To solve this issue, you need to include the SameSite attribute in the setcookie() function with a value of "Strict" or "Lax". This ensures that the cookie is only sent in a first-party context.

setcookie('cookie_name', 'cookie_value', [
    'expires' => time() + 3600,
    'path' => '/',
    'domain' => 'example.com',
    'secure' => true,
    'httponly' => true,
    'samesite' => 'Strict'
]);