An HTTP session is an object that is defined for the lifetime of a client’s TCP session. The Traffic Server API enables you to add a global hook to the start or end of an HTTP session, as well as add session hooks that call back your plugin for every transaction within a given session. When a client connects to Traffic Server, it opens up a TCP connection and sends one or more HTTP requests. An individual request and its response comprise the HTTP transaction. The HTTP session begins when the client opens the connection and ends when the connection closes.
The HTTP session hooks are:
TS_HTTP_SSN_START_HOOKCalled when an HTTP session is started (a session starts when a client connects to Traffic Server). This hook must be added as a global hook.
TS_HTTP_SSN_CLOSE_HOOKCalled when an HTTP session ends (a session ends when the client connection is closed). This hook must be added as a global hook. The relative order of invocation between the
TS_HTTP_SSN_CLOSE_HOOKis undefined. In most cases the
TS_VCONN_CLOSE_HOOKwill execute first, but that is not guaranteed.
Use the session hooks to get a handle to a session (an
object). If you want your plugin to be called back for each transaction
within the session, then use
Note: you must reenable the session with
processing a session hook.
The session hook functions are listed below: