For more information on what merlyn said, see RFC 2965. You can restrict cookies by domain, server, path, port and to only HTTPS.

If you wish to share cookies between servers (even if they're physically the same system, but use different host names), you'll need to set the cookies in a domain that all of the hosts share. If you don't control all of the systems in your domain, you can place them in a subdomain (assuming you have access to DNS in your domain).

For example, I can take two systems, in domain.tld, and give each one a CNAME in shared.domain.tld, so I can then set cookies to be shared between the two systems in .shared.domain.tld (note the initial period). Of course, if someone follows a link that does not refer to the machines as being in the shared subdomain, the cookies won't be sent from the browser. (which can be useful to set both shared and unshared cookies, but you can mess it up very, very easily, if you're not careful.


In reply to Re^2: HTTP cookies and spoofing domain names by jhourcle
in thread HTTP cookies and spoofing domain names by Anonymous Monk

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.