Discussion in 'Perl Misc' started by George Mpouras, Feb 24, 2014.

  1. George Mpouras

    John Bokma Guest

    That's correct, if you mean with "header is printed" that all header(s)
    have been send and a blank line. Hence, you must print your cookie
    before that.

    In Firefox, install the "Live HTTP Headers" add on to see what's being
    John Bokma, Feb 25, 2014
    1. Advertisements

  2. George Mpouras

    John Bokma Guest

    I can imagine that setting a cookie and redirecting to a different
    domain at the same time doesn't work. But again, check with Live HTTP
    headers add on for firefox.
    John Bokma, Feb 25, 2014
    1. Advertisements

  3. That is why I did not print the header when I needed to redirect instead.
    That is why I did not print the header when I still needed to figure out
    the cookie.

    I did test it, it works. You did not.

    I'm now sorry I've tried to assist a proven troll, liar, and half-wit.

    Bye-bye George.

    Xho Jingleheimerschmidt, Feb 26, 2014
  4. It sets a session cookie. Session cookies shouldn't be stored, so it is
    not surprising that you don't see it in cookies.sqlite. You should see
    it in Preferences -> Privacy -> Cookies, however, and - more importantly
    - you should see the effect. If you try to load the script again, you
    are immediately redirected.

    It is true that you can not send any cookie after the header (it needs
    to be in the header, but this this is exactly why Xho sends the cookie
    in the header and not after it. He has shown you how to do it. Please
    make at least a minimal effort to understand the script before repeating
    the problem solved by the very script you are looking at.

    I don't think including relevant information counts as "messing".

    Peter J. Holzer, Feb 26, 2014
  5. You print the header here. Unconditionally (well, almost).

    And then you print the HTML body and finally you try to set the cookie
    So that's your mistake. Although you have repeatedly written yourself
    that you cannot set the cookie after printing the header and although
    Xho showed you how to delay printing the header until you know what
    should go into it, you still do it in a way which you know cannot work.

    Peter J. Holzer, Feb 26, 2014

  6. delay printing the header for the very first redirection ? there is no
    problem there.

    I test xho code (apache at centos 6.5) using firefox as client on
    windows 8 box; there was no cookie after the form submission.
    So what ? may at his environment worked, but not at mine.

    I tired with this thread and I want to get stopped here, ( even more
    after his last post )
    George Mpouras, Feb 26, 2014
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.