I've got a problem that I can't find any reason for. I've got a very simple message board for my site and it uses cookies to store user names and hold unix times for post times. Everything works fine on PC's in all browsers, but on the Mac (both IE and Mozilla) the cookies don't store properly.

The cookies store about 50% of the time but they disapear the next time the script trys to store a cookie. I don't know if this is a common problem. Is there a max length for cookies on the mac? Do they read expiration dates differently?
Any ideas? He're a snipit of the code.
use CGI qw/:standard/; use CGI::Carp 'fatalsToBrowser'; use CGI::Cookie; my $cname = new CGI::Cookie(-name => '2930ForumCookie', -value => "$in{name}|$time|$oldtime", -domain => '.2930online.com', -expires => "$exp"); print "Set-Cookie: $cname\n"; print "Content-type: text/html\n\n";

$exp is set by a form variable and is either +3M or -3M depending on the setting. I always leave it checked (setting it to +3M). $time is just current unix time and $oldtime is the last post time. This is the only place cookies are set though they are read by several scripts.

Thanks in advance for any help.

In reply to Cookies and the macintosh by Bishma

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.