Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tracking cookies
Hi Dan,

Thanks for your quick reply. I had already found a solution like this one, but when I include it in an IWAppFormCreate or IWAppFormRender of a form or in the IWUserSessionBaseCreate of a user session, I don't see my cookies appear.

I'm not sure a cookie added to the WebApplication.Response will last for the whole usersession ? Where best (preferably for all the forms in my application at the same time) to include such a statement ?


(I tried it without HttpOnly and secure options as well...)

best greeting,

Hi Dan,

After a short night's sleep, the best ideas emerge. I came up with this myself...

The -1 resulted in an already expired cookie. I now use 0 to make it a session cookie. The cookie is added once in the IWServerControllerBaseGetSessionID of the servercontroller. After assigning a new session ID, I create the cookie, which will be there throughout the whole session in all forms. My Haproxy configuration, still supporting the old IW_CustomTrackID, now knows how to handle these new sessions as well.

procedure TIWServerController.IWServerControllerBaseGetSessionID
(ASession: TIWApplication; var VNewSessionID: string);
VNewSessionID := ....; // Do here whatever you like
Asession.ResetApplicationID; // Not sure this is needed, but it works ;-)
Asession.Response.Cookies.AddCookie('IW_CustomTrackID',VnewSessionID,'',0,true,true); // Defining the IW_CustomTrackID cookie

Thanks for your inspiration ! Have a great day

best regards,

Messages In This Thread
Tracking cookies - by gerritschurer - 01-04-2021, 09:45 PM
RE: Tracking cookies - by DanBarclay - 01-05-2021, 04:10 AM
RE: Tracking cookies - by gerritschurer - 01-05-2021, 06:21 AM
RE: Tracking cookies - by Alexandre Machado - 01-06-2021, 09:03 AM
RE: Tracking cookies - by kudzu - 01-05-2021, 03:49 PM
RE: Tracking cookies - by DanBarclay - 01-05-2021, 08:22 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)