So you're loading perl CGI A which is pulling in page B containing a form, filling in the values, and submitting it, getting returned page C, which wants to redirect you to page D, and page D wants to set a cookie? And you want the script to hand back page D, correct?

One problem I can see potentially is that when you return page D to the browser, it may try to set cookies again. I might be wrong in this, though.

I haven't played much with writing web-clients in perl (although an upcoming project made this catch my eye), but sounds like what you need to do send the Cookie: param=value header (perhaps using the HTTP::Request module) for each parameter the server is setting/expecting a cookie value to be returned. Otherwise, the page you are going to is trying to set that value.

You might also refer to Clinton Wong's Web Client Programming with Perl (although for some reason I can no longer seem to find it mentioned on O'Reilly's website.

I would be very interested in how you resolve this, and I hope monks of more experience than I who have worked with this will chime in so we both may drink of the wisdom of how to accomplish this.


In reply to Re: Pass cookies from one CGI to another by atcroft
in thread Pass cookies from one CGI to another by chaskins

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.