in reply to Re^2: How can i access a session(CGI::Session) variable in other forms?
in thread How can i access a session(CGI::Session) variable in other forms?

i tried using the "use CGI::Simple::Cookie;" I have tried this way in "form1.cgi"
$log_ses= new CGI::Session(); $CGISESSID = $log_ses->id(); $cookie1 = new CGI::Simple::Cookie( -name=>'ID', -value=>$CGISESSID );
In my "form2.cgi" i have used..
%cookies = fetch CGI::Simple::Cookie; $id = $cookies{'ID'}->value;
when i try to goto form2.cgi...it gives me the following error in the error log.. Can't call method "value" on an undefined value can someone shoot me an example how to handle cookies for session ids??? thanks, simy

Replies are listed 'Best First'.
Re^4: How can i access a session(CGI::Session) variable in other forms?
by ww (Archbishop) on May 08, 2006 at 19:30 UTC
    You might have better success were you to read the documents; a procedure which this node suggests you may have missed. In fact, one could almost conclude from your snippets that there may be a few little points about the relationship between variables and files that has escaped your recall.

    You may also have posed your latest question whilst entertaining a mis-impression of the Monastery: the monks love to help folks learn, but they do NOT comprise a free-coding service.

Re^4: How can i access a session(CGI::Session) variable in other forms?
by jdtoronto (Prior) on May 09, 2006 at 02:50 UTC
    But you see you didn't read the documentation. I don't know how CGI::Simple::Cookie works. In fact it doesn't does it? When I look at the documentation for CGI::Simple I see code which is very different to what you have shown us here.

    You errors are very basic. For example, in Form 2 you do not create a valid CGI::Simple object, nor do you attempt to read the cookie correctly. I suggested earlier that you read the documentation for one very sinmple reason, there is simple explanatory code with copious explanatory notes. I do not believe that the monastery was established so that we could run one on one basic programming classes for people who prefer not to RTFM.

    Please go and read the documentation and the tutorial and if you have a further issue and you have tried the sample code, THEN come back and ask a question.

    jdtoronto