3.2.5.6 Reconnecting and Establishing a New Session Context Server

When the connection between client and server is dropped for whatever reason, the client reconnects with the existing Session Context by sending a Connect or Bind request that includes the existing session cookies saved by the client, as specified in section 2.2.4.1.1. If the previous Session Context is still valid on the server, the server MUST destroy it before creating a new Session Context. The server returns a new session context cookie that is associated with a new Session Context. The server MUST ignore a sequence validation cookie passed in the reconnect scenario. The response from the server uses the Set-Cookie header, as specified in section 2.2.3.2.3, to pass any required cookies to the client. The response includes the Content-Length header, as specified in section 2.2.3.2.1, if the response is not chunked.

As with any new Session Context, the client MUST store all returned cookies and MUST NOT comingle the new cookies with cookies from the previous Session Context.

If the Session Context has expired, is no longer valid, or is not valid for the server in which the mailbox currently resides, then the server fails the request with an X-ResponseCode value of 10, as specified in section 2.2.3.3.3, and the client SHOULD reconnect and establish a new Session Context.