تخطَّ إلى المحتوى

SameSite=None cookie (ARCH7136)

هذا المحتوى غير متوفر بلغتك بعد.

Key php.security.samesite-none-cookie · Severity warning · Category security · CWE CWE-1275

Cookies set with SameSite=None but without Secure are rejected by modern browsers and weaken CSRF posture. If SameSite=None is used, the cookie must also be Secure.

<?php
setcookie('session', $id, [
'samesite' => 'None',
'httponly' => true,
]);
<?php
setcookie('session', $id, [
'samesite' => 'Lax',
'secure' => true,
'httponly' => true,
]);

Prefer SameSite=Lax; if None is required, add the Secure attribute to the cookie.