You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
resp.set_cookie("sessionid", value="value", secure=True, httponly=True, samesite='Strict') # GOOD: Attributes are securely set
returnresp
@app.route("/good2")
defgood2():
resp=make_response()
resp.headers['Set-Cookie'] ="sessionid=value; Secure; HttpOnly; SameSite=Strict"# GOOD: Attributes are securely set
returnresp
@app.route("/bad1")
defbad1():
resp=make_response()
resp.set_cookie("sessionid", value="value", samesite='None') # BAD: the SameSite attribute is set to 'None' and the 'Secure' and 'HttpOnly' attributes are set to False by default.