06-09-2025, 06:33 PM
(This post was last modified: 06-10-2025, 08:39 AM by akanksha.tiwari.)
Hi folks,
I am trying to override DoNewSession() event to write custom code on "/$/Start" call.
What I am facing is that when DoNewSession event is not getting called when "/$/Start" call is received on server instead the thread directly goes to AfterDispatch event from HttpExecute()->DoCommandGet().
I have tried to override rather redefine BaseNewSession, BaseOnConfig, BaseBeforeDispatch but nothing worked.
My redefined functions are calling for other API calls but for /$/Start.
Any leads would help.
Here's the sample code:
My breakpoint doesn't hit here on /$/Start call.
I am trying to override DoNewSession() event to write custom code on "/$/Start" call.
What I am facing is that when DoNewSession event is not getting called when "/$/Start" call is received on server instead the thread directly goes to AfterDispatch event from HttpExecute()->DoCommandGet().
I have tried to override rather redefine BaseNewSession, BaseOnConfig, BaseBeforeDispatch but nothing worked.
My redefined functions are calling for other API calls but for /$/Start.
Any leads would help.
Here's the sample code:
Code:
procedure TIWServerController.IWServerControllerBaseNewSession(
ASession: TIWApplication);
var
lRequest: THttpRequest;
lSession: TIWUserSession;
lPath: String;
begin
//TODO only create this when new user is logging on
ASession.Data := TIWUserSession.Create(nil, ASession);
lPath := ASession.Request.PathInfo;
if (lPath = '/$/start') or
(ServerGlobals.SessionPaths.IndexOf(lPath) <> -1) then
begin
SetNewSessionInfo(ASession, ASession.Data); //custom function to fill session info
end;
end;
