Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to best accomplish this
#3
Can't you use the OnBeforeNewSession event?


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


You probably need to change your CheckTS method to inspect the aRequest.Params object (a TStringList that contains all request parameters), because the seesion hasn't been created yet.

If you set vCanCreate to false within this event IW will skip the session creation code completely and respond with a 404 status, which is exactly what we want for any kind of unauthorized access attempt...
Reply


Messages In This Thread
How to best accomplish this - by PDSBILL - 12-19-2023, 02:41 PM
RE: How to best accomplish this - by MJS@mjs.us - 12-19-2023, 06:26 PM
RE: How to best accomplish this - by Alexandre Machado - 12-20-2023, 01:40 AM
RE: How to best accomplish this - by PDSBILL - 12-20-2023, 02:25 AM
RE: How to best accomplish this - by PDSBILL - 12-20-2023, 06:15 PM
RE: How to best accomplish this - by PDSBILL - 12-21-2023, 08:12 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)