Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Thanks, but that didn't seem to help as much as I'd hoped. I tried to force the save to $Session->param('age'), but now it loses 'name', forcing it to default to ++0, or 1. The result would be to return the correct name and ++$age after the first submit, but "'s new age is 1" and "'s new age is 2" for the subsequent submits. Anything after that continues to repeat the last result.

Sensing that my hidden data isn't being passed after the 2nd invocation (isn't that what CGI::Session is for???), I made the following changes to &add_age to try and get it to force 'name' as well...
sub add_age { my $age = $Session->param('age'); my $name = $Session->param('name'); ++$age; print $Session->param('name'), "\'s new age is $age"; $Session->param(-name=>'age', -value=>$age, -force=>1); $Session->param(-name=>'name', -value=>$name, -force=>1); $Session->save_param($cgi); print $cgi->start_form, $cgi->hidden(-name=>'test', -value=>'test'), $cgi->submit('Next'), $cgi->end_form; }
While it now saves the name correctly, it doesn't increment at all past the first good invocation. How do the CGI gods handle this type of ongoing, looping CGI type? Am I assuming incorrectly in that CGI::Session stores full session state information in the db file? As long as it knows my $sid, and I load it correctly, shouldn't the hidden data always be available to me?

*sigh*

-fuzzyping

In reply to Re: Re: CGI::Session problems by fuzzyping
in thread CGI::Session problems by fuzzyping

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-04-25 06:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found