TsgcWebSocketHTTPServerProperties › AutoStartSession

AutoStartSession Property

Creates a new HTTP session automatically for every incoming request when session state is enabled.

Syntax

public bool AutoStartSession { get; set; }

Default Value

False

Remarks

When both SessionState and AutoStartSession are True, the HTTP server allocates a new TIdHTTPSession (and fires OnSessionStart) the first time it sees a request without a valid session cookie, so server code does not have to call CreateSession() explicitly. Leave this False if you want to decide in handler code whether to create the session or reject the request. The property has no effect when SessionState is False.

Example


oServer = new TsgcWebSocketHTTPServer();
oServer.SessionState = true;
oServer.AutoStartSession = true;
oServer.SessionTimeOut = 600000;
oServer.Active = true;

Back to Properties