Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,155 of 9,155 pages
About the help in other languages
All help pages

Set secure session cookies

Step by step - on an HTTPS-only site, force the Secure flag on Exponential's session cookie, keep HttpOnly and SameSite=Lax, choose a session timeout with your editors, and check the flags with curl.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/government/tasks/compliance/set-secure-session-cookies.md

On this page

Set secure session cookies

For administrators of HTTPS-only sites. By default the session cookie is Secure only when the request itself came over HTTPS (CookieSecure=auto); true forces it, so the cookie is never sent over plain HTTP (13.7 Sessions and cookies).

Contents

  1. Before you start
  2. Steps
  3. Check that it worked
  4. If something goes wrong
  5. Related pages

Before you start

  • The site is served only over HTTPS; behind a proxy, TrustedProxies[] lists it and it sets X-Forwarded-Proto.
  • Agree a session timeout with editors (shipped: 31104000 seconds, 360 days, for both SessionTimeout and RememberMeTimeout).

Steps

  1. In settings/override/site.ini.append.php:

    [Session]
    CookieSecure=true
    CookieHttponly=true
    CookieSameSite=Lax
    SessionTimeout=28800
  2. In PHP's configuration for the site, session.use_strict_mode=1.

  3. php bin/php/ezcache.php --clear-tag=ini --allow-root-user; reload PHP-FPM or deploy on Velocity.

Check that it worked

curl -sI https://www.example.gov/user/login | grep -i set-cookie

shows Secure; HttpOnly; SameSite=Lax on the session cookie. Sign in and work for a while: you stay signed in.

If something goes wrong

  • Signed out on every page: the kernel thinks requests are plain HTTP (proxy not trusted, or no X-Forwarded-Proto); fix the proxy settings (Proxies and trusted headers).
  • SameSite=Strict drops the session on the first click from an e-mail; keep Lax unless you know you need Strict.

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x