TsgcWebSocketHTTPServerEvents › OnSessionEnd

OnSessionEnd Event

Fires when an HTTP session is closed, either explicitly or after SessionTimeout expires.

Syntax

public event {$IFDEF INDY10_5_7} TIdHTTPSessionEndEvent {$ELSE} TOnSessionEndEvent {$ENDIF}Handler OnSessionEnd;
// delegate void {$IFDEF INDY10_5_7} TIdHTTPSessionEndEvent {$ELSE} TOnSessionEndEvent {$ENDIF}Handler(TObject Sender)

Default Value

Remarks

OnSessionEnd is raised when an HTTP session is removed from SessionList. This can happen when the application destroys the session explicitly (for example on logout) or when SessionTimeout expires without new activity from the client. Use it to release per-session resources, commit pending data, or log the session duration. The event signature depends on the underlying Indy version (INDY10_5_7 conditional); the session being closed is usually available through Sender. This event only fires when SessionState is True.

Example

Back to Events