I have converted my dynamic WebDev site to dynamic AWP and used Fabrice's classes for saving context information. However, I made a global procedure that creates a session if a project global variable is 0. I pass the session ID to each page and in the global processing of each page, I set that variable and call the global procedure:
Project code:
gnSessionID is int = 0
Page Global declarations:
PROCEDURE PAGE_Home(gnPar_SessionID is int = 0)
GLOBAL
gnSessionID = gnPar_SessionID
SetSessionContext()
SetSessionContext:
PROCEDURE SetSessionContext()
IF gnSessionID=0 OR gclSession
essionParamRead(gnSessionID,"StartDateTime") = "" THEN
gnSessionID=gclSession:CreateSession()
...
I have traces that show the SetSessionContext is called a second time when the first click is processed on the PAGE_Home and since it was the first and has no passed value, a second session is created before passing the parameter on.
Why is the Page Global declarations executing a second time on the first click?
Is there a better way to do this?
Thanks for any help,