...but it IS of consequence if you thrash $meta_configs{login_cookie_expiration} because you use it two lines after get_timestamp is called.

If you replaced everything within get_timestamp in that way, it should work. The problem is that if you set -expires to 1 (after being chopped from 1h) then the cookie expires immediately. If you would like to see what exactly is going on try connecting to your webserver on port 80 and type in a valid request for the script and see what the head says. If the cookie that the page returns says that it expires Thu, 01-Jan-1970 00:00:01 GMT, then you are using an invalid expiration representation in $meta_configs{login_cookie_expiration} (which is the variable you use for expires). Try printing $meta_configs{login_cookie_expiration} to the page's output. If it doesn't end with s,m,h,d,M, or y, isn't "now", and isn't a fully qualified date, then CGI happily sets the expires to Thu, 01-Jan-1970 00:00:01 GMT.

If you could post the new version of get_timestamp as well as what $meta_configs{login_cookie_expiration} contains, we'd be more than happy to help.

antirice    
The first rule of Perl club is - use Perl
The
ith rule of Perl club is - follow rule i - 1 for i > 1


In reply to Re: Re: Re: chop and CGI.pm cookie problem? by antirice
in thread chop and CGI.pm cookie problem? by michellem

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.