Try it without the -expires option and see if it works. You are using an expiry of 10 minutes which is not very long. A discrepancy between your server clock, and your clients workstation clock could expire the cookie immediately. Remember that it is up to the Client to decide when the cookie should be expired, and it will use it's own clock to decide that.

One way around this problem is to always use the clients time to set expiry times in your cookies. That means using a little bit of JavaScript on your login page to get the workstation's idea of what time it is, and set the expiry at 10 minutes plus that time.

I believe that some servers pass a Date: header in the response (apache does), but I do not know if client side browsers actually use this header to determine cookie expiry timeouts. I would be interested to know if someone has any details on that.

- Cees


In reply to Re: Weirrd Cookie Problems by cees
in thread Weirrd Cookie Problems by batkins

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.