06-12-2025, 04:23 AM
(This post was last modified: 06-12-2025, 04:31 AM by Alexandre Machado.)
First things first: The event name is OnNewSession. DoNewSession() is a public method that triggers the event. As a general recommendation, there is no need to call or change DoNewSession() method in any way.
Now, the event OnNewSession is not triggered when receiving /$/Start request. The /$/Start request will trigger a different request to the application root URL (usually just "/") and this is the actual request that will create a new session and trigger the event.
Regarding your code: there is no need for any check in there. This event is only called once per session, when the session is created, regarldess of the PathInfo content. You just need to call SetNewSessionInfo() after ASession.Data has been assigned. It will just work.
Now, the event OnNewSession is not triggered when receiving /$/Start request. The /$/Start request will trigger a different request to the application root URL (usually just "/") and this is the actual request that will create a new session and trigger the event.
Regarding your code: there is no need for any check in there. This event is only called once per session, when the session is created, regarldess of the PathInfo content. You just need to call SetNewSessionInfo() after ASession.Data has been assigned. It will just work.

