[kw-pm] CGI::Session Question

Robert Pike roberthpike at yahoo.com
Mon Apr 12 08:01:41 PDT 2010

Has anyone experienced or (even better) know the reason why there is a problem with a certain CGI application I'm looking at?
In the mentioned application, data is entered into one form and upon entering various information the form is submitted to another script (maintenance) for processing. After this script finishes it redirects back to the initial calling script. 
I'm using the CGI::Session module from activestate. I store the session ID inside of a cookie and then re-initialize the session if that cookie is present. At the end of the second script (maintenance) I store a hash within the session with the processed data (if I write to a file the hash shows the correct data). Upon being redirected back to the initial script (which displays a data that was processed as well) the session appears to either not exist or seems to be re-initialized (i.e. nothing in it). 
If I stop (i.e. exit) the maintenance script on first call before the script redirects to the other script and then (after it stops) I remove the exit and then refresh the page the session gets stored AND retrieved correctly (for instance a numeric value of 1 gets added for each run of the maintenance script - although by stopping at the end and then refreshing the page I would have thought 2 would have been added). 
I thought maybe it was some weird timing issue but if I store the value in the session and then recall it within the maintenance script, before the page gets redirected, the hash looks like it gets properly saved and retrieved (i.e. wrote to a file). 
Any ideas why this would be happening? Thanks, in advance, for any help.

More information about the kw-pm mailing list