Hi fellow monks,

I have an odd problem, that has been bothering me for a while. I have a fairly complex web database system, with authentication. There is a single program which takes username and password, and then checks authentication (via a database), and, if OK, sets a cookie. Other programs in the suite read the cookie. This works just fine in most browser/OS combinations. But, for some odd reason, in some situations, mostly with Win 98, the cookies just don't get read, and wierd stuff happens with the browsers.

Mostly, people just can't login. Sometimes, the browser hangs.Another browser that doesn't seem to like the cookies is the new Safari browser for Mac OS X. Also, galeon on linux sometimes retains a cookie that I've tried to delete (the log out function.

I'm using the standard CGI cookie, the login and check code is below. What am I missing? Are there known issues with the CGI cookie function? Or with perl cookies?

Thanks for any advice!!

Setting cookies:

if (($user)&&($passcheck)) { my $cookie = cookie(-domain=>"$meta_configs{xina_domain}", -name=>"$meta_configs{login_cookie_name}", -value=>"$login_id", -path=>"$meta_configs{login_cookie_path}", -expires=>"$meta_configs{login_cookie_expir +ation}"); print header(-cookie=>[$cookie]); # cookie set
Checking Cookies:
$login_id = cookie("$meta_configs{login_cookie_name}");
Logging out:
my $cookie = cookie(-domain=>"$meta_configs{xina_domain}", -name=>"$meta_configs{login_cookie_name}", -value=>"$old_cookie{value}", -path=>"$meta_configs{login_cookie_path}", -expires=>"0"); print header(-cookie=>[$cookie]);

In reply to CGI Cookie Problems 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.