Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TIWServerController::OnBeforNewSession()
#1
Hello,

setting the flag vCanCreate = false in the OnBeforNewSession event handler of the server controller
doesn't prevent the server controller from creating a new session !

C++Builder 10.2 Update 3
Intraweb Ultimate Edition 15.0.9

Best Regards
JuergenS
Reply
#2
(07-26-2018, 11:34 AM)JuergenS Wrote: Hello,

setting the flag vCanCreate = false in the OnBeforNewSession event handler of the server controller
doesn't prevent the server controller from creating a new session !

C++Builder 10.2 Update 3
Intraweb Ultimate Edition 15.0.9

Best Regards
JuergenS

Hello,

are you sure? What type of server are you using (Indy, Http.sys, ISAPI)? 

I've just tested it in one of our test case apps and it works as expected...

Do you have any other code handling requests directly (other events like OnBeforeDispatch)?
Reply
#3
(07-31-2018, 04:51 PM)Alexandre Machado Wrote:
(07-26-2018, 11:34 AM)JuergenS Wrote: Hello,

setting the flag vCanCreate = false in the OnBeforNewSession event handler of the server controller
doesn't prevent the server controller from creating a new session !

C++Builder 10.2 Update 3
Intraweb Ultimate Edition 15.0.9

Best Regards
JuergenS

Hello,

are you sure? What type of server are you using (Indy, Http.sys, ISAPI)? 

I've just tested it in one of our test case apps and it works as expected...

Do you have any other code handling requests directly (other events like OnBeforeDispatch)?

Hi Alexandre,

i'm using the default Indy server type.

I  have created a new standard Indy server project with the event IWServerControllerBaseBeforeNewSession() :

void __fastcall TIWServerController::IWServerControllerBaseNewSession(
      TIWApplication *ASession)
{
  ASession->Data = new TIWUserSession(NULL, ASession);
}

void __fastcall TIWServerController::IWServerControllerBaseBeforeNewSession(const UnicodeString aUrlPath,
          THttpRequest *aRequest, bool vCanCreate)
{
    vCanCreate = false;
}

IWServerControllerBaseNewSession() is always called, no matter what value is assigned to vCanCreate ;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)