Session persistence

When a connection between the application server and a client is established, information about the user and the state of the user interface is placed into a session. This session information is temporarily stored in memory, and could be lost when the session times out or the browser is closed. Session persistence allows session information to be stored for a longer period of use.

Session persistence writes the session information to a database or a file when the information would normally be lost. This happens when the session times out, the browser closes, or the application server is busy and needs to balance the load. Session persistence allows users to revisit the server with the same user interface from their last visit. Also, in the event of a server failure, a persisted session retains information that may have been lost, and the client can continue activities after the point of failure.

Application servers can persist sessions in order to help with load balancing for a particular session. If a server node holding session information becomes overloaded, it can persist session information and decide which server node should continue managing the session. Although the application server is able to determine if and how to load balance the sessions, the web server still performs the actual load balancing of the requests.

Information can be persisted to files in a directory or to a session database. File-based persistence is ideal for a single server due to the faster performance provided by the file system and not having to manage connections from multiple nodes.