Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

We need much more information before we can begin to debug this. When someone says they moved a site and cookies have broken, there are a couple of things that usually occur. Here's some typical code (using to create and set a cookie:

my $cookie = $q->cookie( -name => 'session', -value => '123456', -expires => '+1h', -path => '/cgi-bin/admin/', -domain => '', -secure => 1); print $q->header( -cookie => $cookie );

Here's what usually happens to screw that up.

  • The domain is different or you're using an IP address which causes the cookie to fail. The cookie will only be returned if the domain specified matches. If your cookie domain is '' and the site is '', the cookie will be returned. If the cookie domain is '' and the site is '', you will get no cookie.
  • The site gets reconfigured so that the path information is no longer the same. If /cgi-cin/admin/ is now /cgi-bin/management/ and that's the path specification, your cookies will not be returned.
  • The secure switch is set, but the site is no longer running on SSL. I recently had an administrative console break because we moved the site and someone forgot to get an SSL certificate, so they just turned off SSL. My site breaking was a Good Thing.

If this doesn't answer your question, post the code that sets the cookie and the code that retrieves the cookie, along with relevant path and domain info.


Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

In reply to Re: Cookie Linux problem retrieving cookies by Ovid
in thread Cookie Linux problem retrieving cookies by Anonymous Monk

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others contemplating the Monastery: (4)
    As of 2018-02-20 02:10 GMT
    Find Nodes?
      Voting Booth?
      When it is dark outside I am happiest to see ...

      Results (266 votes). Check out past polls.