I'm doing a similar thing but using a session id.
On sucessful login a session id is created using the following:
User name
HTTP User Agent
IP address <- can change paticularly with aol users and proxy servers
Day-of-the-year
and a "secret" constant string

This is fed to MD5 which computes the checksum of it and stores it in a cookie along with the users name.

Everytime a script is requested the session id is checked by re-creating the session id and comparing it to the one in the cookie.

For someone to fake a session id they need all of the above information including the "secret" string and what order i joined them together.

The logout is simple, just delete the session id from the cookie.

More secure IMOHO than sending any form of the password over the net to store in a cookie. (Remembering it was sent once when the user logged on but for that you should use ssl).

I found this site very usuful when putting this togeather. Good luck
Nomis52


In reply to Re: Is this use of crypt() appropriate? by Nomis52
in thread Is this use of crypt() appropriate? 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.