Welcome! Log In Create A New Profile

Advanced

AWP Context Problem

Posted by Jeff Graham 
Jeff Graham
AWP Context Problem
May 29, 2008 08:02PM
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 gclSessionconfused smileyessionParamRead(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,
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: