3.1.5.2 Processing Exclusive Get Requests

A client that uses a state server makes either an exclusive or a non-exclusive request to a state server implementation for session state data.<7>

For an exclusive request, the client uses the message format that is specified in section 2.2.5.3. A state server implementation MUST attempt to retrieve the session state data that corresponds to the unique identifier that is contained in the combination of application-identifier, appdomain-identifier, and session-identifier. A state server MUST NOT interpret these values or assign any specific relevance to them. Rather, a state server implementation MUST simply use the combination of those values as the unique identifier for retrieving any previously stored session state that is associated with the combination of those identifiers.

The state server MUST send a response back to the client by using one of the message formats that are specified in section 2.2.5.4.

If the state server finds session data that is associated with the requested identifier and the data is not locked by another request, it MUST reply to the client with the response-ok message.

As part of this message, the state server MUST include the action-flags information, if during a previous set operation, as specified in section 2.2.5.5, the client web server sent extra-flags to the state server with a value of "1".  The state server MUST also reset the action-flags value stored by the state server to a value of "0".

The state server MUST also internally mark the session data in a way that indicates the session data is now considered locked, and is not available to other requestors. As part of this logical operation, the state server MUST return an integer representation of the lock to the client. The lock-cookie (section 2.2.3.9) portion of the response-ok message is where the state server MUST include this lock information in its response. Internally, the state server MUST also note the date and time when the lock is established.

If the state server finds session data that is associated with the requested identifier but the session data is locked by another request (that is, two or more clients are simultaneously running, and each client is using the same identifier), the state server MUST respond by using a response-locked message, as specified in section 2.2.5.4. The response-locked message contains a lock-age (section 2.2.3.10) and lock-date (section 2.2.3.8) in addition to the value of the current lock-cookie. The lock-cookie is an integer representation of the current lock. The lock-date value MUST contain the date and time the existing lock was placed on the session state data. The lock-age header MUST contain a representation for the age of the current lock.

If the state server cannot find any session data that is associated with the requested identifier, the state server MUST respond with a response-not-found message, as specified in section 2.2.5.4.

The response-bad-request message, as specified in section 2.2.5.4, is conceptually equivalent to throwing an exception. The session state server MUST send this message if something goes wrong and the server is unable to process the request.