Hi monks,
I've got a form created by a cgi script (sorry, I'm one of those who discovered Perl through cgi). When someone clicks on a button on the form another script is supposed to read the data from the button and a hidden input and write them to cookies. It works fine in Firefox, Galeon loves it, IE doesn't want to know about it.
I'm pretty sure the problem is that the cookie isn't being set because it isn't picking up the cookie value in the next script. I've tried using CGI::Cookie but wound up with the same results.
I've gone back to my original code to try and sort this out. Here it is:
Set the cookies and redirect:
# Process form and set cookies my ($cat) = param('butCat'); my ($typ) = param('txtTyp'); my ($to_set) = cookie(-name => 'cat', -value => $cat, -path => '/', ); my ($to_set_a) = cookie(-name => 'bus_com', -value => $typ, -path => '/', ); my $cgi = CGI->new(); print $cgi->redirect(-uri => '/'.$typ.'sub.html', -cookie => [$to_ +set, $to_set_a]);
Get the cookie in the next script:
# Get Subcat data from cat cookie $catnum = cookie('cat');
To see it in action (or not) go to www.martoncentral.co.nz/buslst.html and click on any of the sub category buttons towards the top of the page. Thanks in advance for sharing your wisdom.

In reply to IE not setting or retireving cookies by greymoose

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



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.