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

Sessions across servers

For IT teams running an Exponential site on several web servers. Where sessions are kept (PHP files or the database), how to keep editors signed in when a load balancer moves them between servers, what a failed node…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/government/operations/availability/sessions-across-servers.md

On this page

Sessions across servers

This page is for infrastructure teams in public bodies that run an Exponential site on more than one web server. It answers where sessions are kept, the two ways to keep signed-in editors signed in across servers, what happens to them when a server fails, and which session settings matter. The references are Sessions and Several web nodes.

Contents

  1. Where sessions are kept
  2. Two ways to work across servers
  3. What a failed server means
  4. Settings that matter
  5. Checklist

Where sessions are kept

A session keeps one browser signed in. site.ini [Session] Handler decides where it is kept:

HandlerWhereSeveral servers
empty (default): ezpSessionHandlerPHPPHP's own session storage, usually files on the servereach server knows only its own sessions
ezpSessionHandlerDBthe ezsession table of the site's databaseevery server sees every session

Anonymous visitors usually have no session at all; this matters for editors and other signed-in users.

Two ways to work across servers

Sessions in the database. Set the handler in settings/override/site.ini.append.php:

[Session]
Handler=ezpSessionHandlerDB

Every node reads the same table, so the load balancer may send a user to any node. A further benefit for public bodies: Setup > Sessions can then list and remove sessions, for example to sign out a suspected compromised account at once (Sessions). With the default handler that page cannot list or remove sessions one by one; it shows who signed in recently instead.

Keep each user on one node. A balancer that routes by the session cookie keeps a user on the node that holds the session. [Session] CookieAlwaysAddToHttpResponse=enabled sends the session cookie with every response once a session runs, for such a balancer; those responses go out with Cache-Control: private (Security and audit).

Sessions in the databaseSession affinity
Balancer configurationnonerouting by cookie
A node failsusers stay signed inits users are signed out
Setup > Sessions lists and removes sessionsyesno
Load on the databaseone more table in usenone extra

What a failed server means

With affinity, a failed node signs its users out: editors lose unsaved form input of the moment, but drafts that were stored stay in the database (My drafts and my pending items). With sessions in the database, the next request goes to another node and the user carries on. For a site where editors must keep working during an incident, choose the database handler.

Settings that matter

Setting (site.ini [Session])DefaultMeaning
SessionTimeout31104000 (360 days)a session ends this many seconds after its last use
CookieSecureautoSecure cookie over HTTPS; behind a balancer that terminates TLS it needs X-Forwarded-Proto from a trusted proxy
CookieHttponlytruethe cookie is not readable by scripts
CookieSameSiteLaxnot sent with cross-site requests

A shorter SessionTimeout for the administration may be a requirement of your security policy; set it in the administration siteaccess's settings. Logging out ends the session for good under every handler, and a password change ends other sessions ([PasswordSettings] EndOtherSessions=enabled) (Security standards).

Checklist

  • To do: With several servers: ezpSessionHandlerDB, or session affinity agreed with the network team.
  • To do: The trade-off for a failed node is documented.
  • To do: TrustedProxies[] lists the balancer, so the Secure flag is right behind TLS termination.
  • To do: SessionTimeout matches your security policy.

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