I personally use Apache2, with Mason, and mod_perl2, while mod_perl2 is only in dev it seems to perform just as well now as mod_perl.

My login script consists of a simple sql lookup on a users table. If found, I create a new session using Apache::Sesssion::Postgres and then set a cookie such that its value is the session's id.

Then in an autohandler in a folder named /auth_required/ or the like, I check for a cookie using Apache2::Cookie and then I check the cookie's value $cookie->value to make sure the value or session id does exist in my session table (you create this to use anthing Apache::Session::*). If all is there I move on.

I save the session to a global variable $S, and the user data to a global variable $U to eliminate the need to pass it explicitly to other mason components.



Evan Carroll
www.EvanCarroll.com

In reply to Re: Perl/CGI login by EvanCarroll
in thread Perl/CGI login by muclc7

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.