Skip to content

Cookies ​

Cookies used by Etherpad.

NameSample valueDomainPathExpires/max-ageHttp-onlySecureUsage description
express_sids%3A7yCNjRmTW8ylGQ53I2IhOwYF9...example.org/SessiontruetrueSession ID of the Express web framework. When Etherpad is behind a reverse proxy, and an administrator wants to use session stickiness, he may use this cookie. If you are behind a reverse proxy, please remember to set trustProxy: true in settings.json. Set in webaccess.js#L131.
languageenexample.org/SessionfalsetrueThe language of the UI (e.g.: en-GB, it). Set by the pad client when the user changes My View → Language (currently in src/static/js/pad.ts, via setMyViewLanguage()).
prefs / prefsHttp%7B%22epThemesExtTheme%22...example.org/pyear 3000falsetrueClient-side preferences (e.g.: font family, chat always visible, show authorship colors, ...). Set in pad_cookie.js#L49. prefs is used if Etherpad is accessed over HTTPS, prefsHttp if accessed over HTTP. For more info see https://github.com/ether/etherpad-lite/issues/3179. Session transfer (/tokenTransfer) carries these preferences to the new device and writes them under the name matching the protocol of the redeeming request (prefs over HTTPS, which requires trustProxy: true behind a TLS-terminating reverse proxy, prefsHttp over HTTP).
tokent.tFzkihhhBf4xKEpCK3PUexample.org/60 daystruetrueA random token representing the author, of the form t.randomstring_of_length_20. Set by the server as an HttpOnly; SameSite=Lax cookie on the first GET to /p/:pad (see src/node/utils/ensureAuthorTokenCookie.ts). The server reads the cookie from the socket.io handshake in PadMessageHandler.handleClientReady to resolve the author. Not readable from browser JavaScript. See privacy.md.

For more info, visit the related discussion at https://github.com/ether/etherpad-lite/issues/3563.

Cookies on pad sockets from other origins ​

Browsers send these cookies with a socket.io handshake based on the site, so a page on a sibling subdomain (or any site, with SameSite=None) can open a pad socket that carries them. The pad client therefore fetches a short token from GET /pad-socket-token (same origin, no CORS) and sends it with the handshake. The token is bound to the token, sessionID and logged-in express_sid cookies of that request. The token request and the socket.io handshake must therefore carry the same cookies: if you set the sessionID cookie yourself, give it a Path that covers both /pad-socket-token and /socket.io/ (normally Path=/, or the base path when Etherpad runs under a proxy path). A cookie scoped to /socket.io alone makes the token not match, so the socket is treated as coming from another origin unless Sec-Fetch-Site or the Origin fallbacks admit it.

A pad socket may use the cookies when it has a valid token, an Origin listed in socketIo.padAllowedOrigins or socketIo.allowedOrigins, a Sec-Fetch-Site of same-origin, no Origin header (non-browser clients), or an Origin matching the Host header, X-Forwarded-Host (with trustProxy) or publicURL. A Sec-Fetch-Site of same-site or cross-site overrides everything except the allowlists. Any other pad socket comes from another origin. socketIo.crossOriginPadSockets decides what happens to it: "anonymous" (default) ignores its cookies, "reject" refuses it and "allow" trusts it.

Etherpad HTTP API clients may make use (if they choose so) to send another cookie:

NameSample valueDomainUsage description
sessionIDs.1c70968b333b25476a2c7bdd0e0bed17example.orgSessions can be created between a group and an author. This allows an author to access more than one group. The sessionID is set as a cookie by the integrator and is valid until a certain date. The session cookie can also contain multiple comma-separated sessionIDs, allowing a user to edit pads in different groups at the same time. Since #7045 Etherpad reads this cookie server-side from the socket.io handshake, so integrators should set it as HttpOnly; Secure; SameSite=Lax to mitigate XSS. More info - https://github.com/ether/etherpad-lite/blob/develop/doc/api/http_api.md#session

Published under Apache License