mecha-cms / mecha

Minimalist content management system.

Home Page:https://mecha-cms.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TODO: Make `SameSite` Cookie Available Across PHP Version(s)

taufik-nurrohman opened this issue · comments

Source: https://github.com/GoogleChromeLabs/samesite-examples/blob/ff451720690e740d0934ff7746df366994112084/php.md

Use header() function instead of setcookie() function for compatibility with PHP versions older than 7.3.0:

// Set a same-site cookie for first-party contexts
header('Set-Cookie: cookie1=value1; SameSite=Lax', false);
// Set a cross-site cookie for third-party contexts
header('Set-Cookie: cookie2=value2; SameSite=None; Secure', false);

Ummm. Let’s just drop PHP 7.1.0 support then 😕

Screenshot 2021-12-21 at 10-02-01 PHP Supported Versions

Screenshot 2021-12-21 at 10-00-43 PHP Supported Versions