Created by Wang, Jerry, last modified on Jul 04, 2016

Sticky sessions means that when multiple instances of an application are running on CF, requests from a particular client always reach the same application instance. This allows applications to store session data specific to a user session.

To support sticky sessions, applications must return a JSESSIONID cookie in responses.

If an application returns a JSESSIONID cookie to a client request, the CF routing tier appends a second cookie, called VCAP_ID containing a unique identifier for the application instance. On subsequent requests, the client must provide both the JSESSIONID and VCAP_ID cookies. The CF routing tier uses the VCAP_ID to forward client requests to the same application instance every time.

CF does not persist or replicate HTTP session data across application instances. If an instance of an application crashes or is stopped, session data for that instance is lost. If you require session data to persist across crashed or stopped instances, or to be shared by all instances of an application, store session data in a CF marketplace service that offers data persistence. For more of Jerry’s original articles, please follow the public account “Wang Zixi “: