Hi sulfericacid,

Others have attempted to show you problems with the script, so I won't bother. But, I do think you are having problems with what cookies actually are - for example, you say "I know cookies are gone the minute the window is closed": well, no, not quite. Some are, some aren't. If you set one to last two years, it should last that long come what may.

What browser do you use? If you have something like Mozilla or Epiphany, you can actually look at the cookies themselves quite easily. This will allow you to actually check whether or not the cookie is being set. This is quite important - you could have two errors in your script. You're not going to read back the cookie if you don't manage to set it, and it you're both not setting it correct nor reading it back correctly, then you will mess around for ages and probably not get anywhere.

Always best to try to narrow the problem down to as small an area as possible. If you can check the cookie is being set, then you know you have a problem reading the cookie back. If it's not, you know you're not setting it.


In reply to Re: Cookie time again *eats cookie* by kal
in thread Cookie time again *eats cookie* by sulfericacid

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.