Hi,

I've put together some PERL code for a small website I'm making. I have managed to have it take a user given username and password, and be directed to a page based on a third field "access" using MySQL tables.

What I don't have, and need is a way to created a cookie to remember who they are when they log in.

This would serve 2 purpose. Be able to use that cookie to greet them, and use the cookie as security for the pages. (no cookie means they didn't log in, yadda yadda).

I've seen a lot of CGI cookie techniques, none of which I could get to work. Perhaps my Host is missing something? It would only type on the screen what I had in my .pl file.

So I need a bit of code that I can put in a .pl file that would save form info into a cookie that is not CGI, but just PERL.

Please help!

Thanks for your time.

update (broquaint): added formatting and title change (was Should be simple enough.)


In reply to Looking for CGI session guidance 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.