Browse Source

Set "SameSite=None" if CSRF Protection is disabled

PR #18843.
adaptive-webui-19844
七海千秋 2 years ago committed by GitHub
parent
commit
1e400df324
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/webui/webapplication.cpp

2
src/webui/webapplication.cpp

@ -683,6 +683,8 @@ void WebApplication::sessionStart() @@ -683,6 +683,8 @@ void WebApplication::sessionStart()
QByteArray cookieRawForm = cookie.toRawForm();
if (m_isCSRFProtectionEnabled)
cookieRawForm.append("; SameSite=Strict");
else if (cookie.isSecure())
cookieRawForm.append("; SameSite=None");
setHeader({Http::HEADER_SET_COOKIE, QString::fromLatin1(cookieRawForm)});
}

Loading…
Cancel
Save