Hello Monks,

I'm using CGI::Cookie trying to set an expire value for 30 minutes ( '+30m' ). Safari won't accept the value and leaves the expire field blank.

Does anyone know a solution for this using CGI::Cookie?

The cookie expirations are working perfectly in Firefox, Opera, and IE.

I've searched around the monastery and tried to find any information about the problem with no luck. I found HTTP::Cookies::Safari, which seems to address the problem in it's README:

This package overrides the load() and save() methods of HTTP::Cookies so it can work with Safari cookie files.

Note: If the source Safari cookie file specifies and expiry date past the unix 32-bit epoch, this file changes the expiry date to 0xFFFFFFFF in unix seconds. That should be enough for anyone, at least to the next release.
use strict; use warnings; use CGI; use CGI::Cookie; my $c = new CGI::Cookie( -name => 'session_id', -value => '23423', -domain => '.testdomain.com', -path => '/testfolder', -expires => '+30m', ); print header(-cookie=>$c); #--- Rest of Script
Thanks,
Tatnall
"Recognizing who we aren't is only the first step toward knowing who we are." - Os Guinness

In reply to CGI::Cookie - Safari won't accept -expires by Tatnall

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.