Session Configuration

From CauchoWiki

Jump to: navigation, search


Session configuration occurs in three contexts:

The <server> block has a separate cookie configuration because the load-balancers need to detect and parse the session cookie on a server-wide basis to implement sticky sessions.

[edit] session-config

attributemeaningdefault
always-load-sessionFor persistent sessions, always query the database for updatesfalse
always-save-sessionFor persistent sessions, always save the session at the end of a requestfalse
cookie-append-server-indexAppend the server's cluster index to the generated cookie (3.0.18)false
cookie-domainThe host domain for the cookie, e.g. foo.comnone
cookie-lengthThe number of characters in the session cookie18
cookie-max-ageHow long a cookie should be stored in a browsernone - the browser session
cookie-modulo-clusterControls the cookie generation for sticky sessions and clusteringfalse
cookie-portControls the cookie's required portnone
cookie-secureIf true, the browser will only send the cookie on a secure connectionfalse
cookie-versionThe specification number of the cookie spec0
enable-cookiesIf true, generate and use session cookietrue
enable-url-rewritingIf true, generate and use URL rewritingtrue
ignore-serialization-errorsFor persistent sessions, skip non-serializable attributefalse
invalidate-after-listenerIf true, invalidate the session only after the session listeners are calledtrue
reuse-session-idtrue|
save-only-on-shutdownIf true, persistent sessions are only saved when the server shuts down gracefullyfalse
session-maxThe maximum number of sessions in memory at any time (LRU)4096
session-timeoutHow long an idle session should live before being timed out (in minutes)30
use-persistent-storeIf true, enable persistent storage for the sessionfalse

[edit] <server> configuration for sessions

The attributes belong in the <server> block

AttributeMeaningDefault
alternate-session-url-prefixAn alternative URL prefix for sessionsnone
session-cookieThe cookie to use for sessionsJSESSIONID
ssl-session-cookieThe cookie to use for sessions for an SSL portJSESSIONID
session-url-prefixThe URL fragment to use for URL-rewriting;jsessionid=
Personal tools