Cookies

Last modified by Eleni Cojocariu on 2026/12/04 12:42

Every cookie XWiki core sets, with what it holds, where it is scoped, how long it lasts and whether it is restricted to HTTPS.

Reference

XWiki stores a handful of cookies on the reader's machine. Most of them only remember a preference, but four of them sign a returning reader back in without a new login, which is what makes the set worth an attacker's attention.

The table below is the list for XWiki core. An installed extension may set cookies of its own, and documents them on its own page.

The four authentication cookies are named after xwiki.authentication.cookieprefix, which is empty unless you set it. That property and every other one named below live in xwiki.cfg and are described in Authentication Parameters.

CookieContentPathDomainMax ageSecureHTTP onlyPurpose
JSESSIONIDThe HTTP session identifier.The web application's context path, /xwiki by defaultThe server nameThe session, which the Servlet Container times out after 30 minutes under Tomcat's defaultsOnly over HTTPS, and only where the container sets the flagDepends on the Servlet ContainerCreated by the Servlet Container rather than by XWiki
ckCsrfTokenA 40-character random token./The server nameThe sessionNoNo, because it is written from JavaScriptCreated by CKEditor for its own uploads. XWiki never reads it and protects its own forms with the CSRF token mechanism
languageThe locale the reader chose./None10 yearsNoNoRemembers the chosen locale, and is only set on a multilingual wiki
visitidA random 32-character alphanumeric value./The entry of xwiki.authentication.cookiedomains matching the server name, none when none matchesA fixed date, 31 December 2029NoNoRecognizes a returning visitor for the statistics module, whose storage is off by default
[xwiki.authentication.cookieprefix]usernameThe encrypted user name.xwiki.authentication.cookiepath, / by defaultThe entry of xwiki.authentication.cookiedomains matching the server name, none when none matchesxwiki.authentication.cookielife days, 15 by default, or the browser session when "Remember me" was not tickedOnly over HTTPSYesSigns a returning reader back in without a new login
[xwiki.authentication.cookieprefix]passwordThe encrypted password.xwiki.authentication.cookiepath, / by defaultThe entry of xwiki.authentication.cookiedomains matching the server name, none when none matchesxwiki.authentication.cookielife days, 15 by default, or the browser session when "Remember me" was not tickedOnly over HTTPSYesSigns a returning reader back in without a new login
[xwiki.authentication.cookieprefix]remembermetrue when "Remember me" was ticked, false otherwise.xwiki.authentication.cookiepath, / by defaultThe entry of xwiki.authentication.cookiedomains matching the server name, none when none matchesxwiki.authentication.cookielife days, 15 by default, or the browser session when "Remember me" was not tickedOnly over HTTPSYesSigns a returning reader back in without a new login
[xwiki.authentication.cookieprefix]validationAn MD5 hash over the two encrypted values above, the client IP address when xwiki.authentication.useip is on, and xwiki.authentication.validationKey.xwiki.authentication.cookiepath, / by defaultThe entry of xwiki.authentication.cookiedomains matching the server name, none when none matchesxwiki.authentication.cookielife days, 15 by default, or the browser session when "Remember me" was not tickedOnly over HTTPSYesSigns a returning reader back in without a new login

Secure means the browser only sends the cookie over HTTPS. HTTP only means a script running in the page cannot read it.

Three of those cookies carry the credentials themselves: the user name, the password and a validation hash over both. All three are encrypted before they are stored, so an attacker who obtains them still cannot read the account's user name and password.

Encryption stops an attacker reading a stolen cookie. It does not stop them replaying it. XWiki therefore binds each authentication cookie to the IP address that obtained it and refuses it from any other, which xwiki.authentication.useip turns off for the networks where a reader's address legitimately changes. How a cookie gets stolen in the first place is covered in Attack Vectors.

FAQ

Can XWiki run without setting cookies?

No. The session cookie belongs to the Servlet Container and the wiki cannot work without a session. The four authentication cookies are different: they are only stored when a reader ticks "Remember me", so a wiki whose readers never tick it keeps nothing beyond the session.

Why is ckCsrfToken neither secure nor HTTP only?

CKEditor writes it from JavaScript and reads it back the same way, so neither flag can be set on it. It carries no credential, and XWiki does not use it for anything.

Related

Get Connected