Things to know about cookies:

The server requests that a cookie be set - Your server application has no control over whether a cookie has been set. Your app will only know when the user requests the next page. Features such as session tracking can be handled using non-cookie means such as URL re-writing.

The browser makes the rules - Your app can only request that a cookie be stored. It is up to the browser settings (as dictated by the user, sys policy etc.) whether to cooperate with a set-cookie request. The decision depends on the security and privacy settings implemented by the browser.

The rules are changing - It used to be the case that browsers had a config option to turn cookies on or off. Then there came 'security zones' which divided the network up into internet, intranet and trusted zones. A different cookie policy could be enforced for all. Now the cookie settings are more associated with privacy and things such as third-party cookies and cookies that contain identifiable information are normally turned off. A new feature is the P3P policy of a server. This is a method that the site owners have of declaring their cookie usage policy such that it can be enforced by the browser.

Bug Fixing

I find that working with Mozilla gives me the flexibility that I need when debugging cookie related issues. Just set your preferences to 'always ask' about cookies so that you can watch the cookie setting process. There is also an addin that allows you to watch the HTTP headers (I forget what it's called but I am sure that another monk will help out).


In reply to Re: cookie retrieval problem by inman
in thread cookie retrieval problem by Nik

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.