1. If you encrypt using md5, how do you expect do decrypt?
  2. If you encrypt using another scheme, how do you get back data the user has deleted from the cookie?

There is only one truely safe way to do this, and that is to maintain state with a cookie (or hidden params) (see previous post). The information stored server side is non-volatile, any information stored in a cookie is volatile and susceptible to tampering/attack/deletion et al.

Using a session NDV session id makes everything *that* much more safer. Of course there is safe and there is *safe*, and any solution chosen should represent the level of risk allowable for the project.

For example a site may manage content via a cookie, and default to a default page if the cookie is not found, however a bank may use any combination of challenge/response using a 3rd party token generator (ala secure_id)...

IMO it is *so* easy to produce a decent level of security with a NDV sess_id, and storing the information server side, why not do it? why put information into a volitile data source?


In reply to Re: Re: Re: cookies n variables by Ryszard
in thread cookies n variables by wolverina

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.