Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ServerController.OnBeforeNewSession
#2
(04-07-2018, 06:52 PM)DanielFields Wrote: I'm trying this method out before using it in a live setting.  The result of the code below is a blank screen.  Is there some way to return text, or an error message?



Code:
procedure TIWServerController.IWServerControllerBaseBeforeNewSession(const aUrlPath: string; aRequest: THttpRequest; out vCanCreate: Boolean);
begin
  vCanCreate := false;
end;

Hi Daniel,

I think you are trying to use this event to actually block some user from starting a session and, at the same time, provide some feedback, right? I have to give it a thought. When you don't allow a session creation IW will return HTTP status code 404, not 200.
In order to provide a page containing error information you would have to have full access to a response object. Not sure if it is possible without a few changes....
Reply


Messages In This Thread
RE: ServerController.OnBeforeNewSession - by Alexandre Machado - 04-09-2018, 11:15 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)