Internet Direct (Indy) Version 9.0.2 Beta
TIdHTTPServer.CreateSession
Creates a new HTTP session.

function CreateSession(AThread: TIdPeerThread; HTTPResponse: TIdHTTPResponseInfo; HTTPRequest: TIdHTTPRequestInfo): TIdHTTPSession;
Parameters
AThread: TIdPeerThread
The response to use for the session.

HTTPResponse: TIdHTTPResponseInfo
The request to use for the session.

HTTPRequest: TIdHTTPRequestInfo
Returns
TIdHTTPSession - The session created for the HTTP request and response.

Description
CreateSession is a TIdHTTPSession function used to retrieve a new persistent HTTP session.

CreateSession initializes a new HTTP session with a unique SessionID and the IP address specified in the HTTPRequest parameter. SessionID is added as the cookie 'IDHTTPSESSIONID' to the HTTPResponse parameter. The new session is also added to the session list for the server.

If SessionState is False, CreateSession will perform no action and return the value Nil.