Hello all,
I have been using cookies quite succesfully until I got to this point. The script has a button for 'Save Settings', associated with a textfield called 'spcSaveName'. When this button is clicked the script is re-opened and new info is displayed. The cookie part of the script has:
$spcName = $query->cookie(-name=>'spcName', -value=>$query->param('spc
+SaveName'));
print $query->header(-cookie=>[$spcName]);
at the top.
Straight after this I test the values with:
print $query->param('spcSaveName');
print $spcName;
print $query->cookie(-name=>'spcName');
When I click Save the first time $query->cookie(-name=>'spcName') has no value. If I click 'Back' and 'Save Settings' again, then the cookie value is correct?
Any ideas why this only works after the second click? Also, if you are wondering if there is any other code there that might be affecting the cookie creation, there's not. I even commented out everything else, just in case.
Thank you.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.