How to fix it
Set the flags at the framework level so every cookie inherits them.
PHP (php.ini):
session.cookie_secure = 1
session.cookie_httponly = 1
session.cookie_samesite = "Lax"
ASP.NET (web.config):
<system.web>
<httpCookies requireSSL="true" httpOnlyCookies="true" sameSite="Lax" />
<sessionState cookieRequireSSL="true" cookieSameSite="Lax" />
</system.web>
Express (Node.js) with express-session:
app.use(session({
cookie: { secure: true, httpOnly: true, sameSite: 'lax' }
}));
Django (settings.py):
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
SESSION_COOKIE_SAMESITE = 'Lax'
CSRF_COOKIE_SECURE = True
CSRF_COOKIE_SAMESITE = 'Lax'
Rails (config/initializers/session_store.rb):
Rails.application.config.session_store :cookie_store,
key: '_app_session', secure: true, httponly: true, same_site: :lax
Cookie naming convention — for the strongest guarantee, prefix your session cookie with __Host- (e.g., __Host-Session=...). Browsers refuse to set this prefix without Secure and a path of /, and refuse a Domain attribute. Belt-and-suspenders against misconfiguration.
Verify with: curl -I https://example.com/ | grep -i set-cookie