Topic Path: Symbol Reference > Classes > TIdCustomHTTPServer Class > TIdCustomHTTPServer Methods > CreateSession Method
TIdCustomHTTPServer.CreateSession Method

Creates a new HTTP session.

function CreateSession(
    AContext: TIdContext; 
    HTTPResponse: TIdHTTPResponseInfo; 
    HTTPRequest: TIdHTTPRequestInfo
): TIdHTTPSession;
Client connection for the session.
The response to use for the session.
The request to use for the session. 

TIdHTTPSession - The session created for the HTTP request and response.

CreateSession is a TIdHTTPSession function used to get a new persistent HTTP session for the server implementation. CreateSession creates a new HTTP session with a unique SessionID for the IP address specified in the HTTPRequest parameter. 

SessionID is added to the HTTPResponse as the GSessionIDCookie cookie. The new session is assigned to both the HTTP Request and the HTTP Response for the executing client thread, and added to the SessionList for the server. 

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

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.