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

SameSite=None cookie without Secure (ARCH2136)

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

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

SameSite=None cookies without the Secure attribute are rejected by browsers and weaken the CSRF posture. Set Secure together with SameSite=None.

def set_cookie(resp, token):
resp.set_cookie("session", token, samesite="None")
def set_cookie(resp, token):
resp.set_cookie("session", token, samesite="None", secure=True)

Always mark the cookie Secure when using SameSite=None.