Cookie Without SameSite Attribute対策

Cookieの作り方に気をつける。

Cookie Without SameSite Attribute

OWASP ZAP – Cookie without SameSite Attribute
The world’s most widely used web app scanner. Free and open source. Actively maintained by a dedicated international tea...

cookie使うならSameSite属性を設定しろって話。

こんな感じ

phpで組んでたのでphpでの方法。

setcookie('cookie_key', 'cookie_value', [
    'expires' => 0,
    'path' => '/',
    'samesite' => 'strict',
    'secure' => true,
    'httponly' => true,
]);

cookie_name、coolie_valueに任意のものを入れてあとはそのまま。

設定内容の意味を知りたければ詳しい記事を読みましょう。

コメント

タイトルとURLをコピーしました