Using HTTP sessions

HTTP connections can create an HTTP session to maintain state between HTTP requests.

An HTTP session provides the means for persisting the client (typically a web-browser) state with minimal SQL application code. A database connection under a session context is held for the duration of the session's lifetime. Each new HTTP request that is marked with a session ID is serialized (queued) so that each request with the same session ID is sequentially processed using the same database connection. Reusing the database connection provides the means of maintaining state information between HTTP requests. In contrast, sessionless HTTP requests create a new database connection for each request and data from temporary tables and connection variables cannot be shared across requests.

HTTP session management provides support for both URL and cookie state management techniques.

A working example of the HTTP session features is provided in samples-dir\SQLAnywhere\HTTP\session.sql.


Creating an HTTP session
Session management with cookies
Detection of stale sessions
Deleting or changing the session ID
Session semantics
Dropping a connection and server shutdown
Session timeout
Session scope
Licensing
Session errors
Summary of session connection properties and options
Administration