OxPM: Login modules?

Dan dan at devilock.mine.nu
Wed Apr 14 09:46:17 CDT 2004


> You'd have thought so, wouldn't you. I mean, php has this sort of
> session management built in, doesn't it?

Yes it does, but then PHP has a lot of stuff set up server-wide to describe
how sessions are stored.. (not to mention db configs and the like)

>Does anybody here have a suggestion?

Yep. You can do similar session persistence with Apache::Session
(http://search.cpan.org/~jbaker/Apache-Session-1.6/Session.pm) Which
according to the perldoc will work with CGI (Tho I thought it was a mod_perl
thing until I looked)

Although full session persistence might be a bit over the top for your
needs. I tend to use something a bit simpler that just stores a GUID for
each logged in user and checks it against the cookie each time.
Here's the code I've used in the past:
http://devilock.mine.nu/login.txt

(It's been hastily pulled out of a working script and commented, so it may
or may not need a tweak to get it working. Works for me, but YMMV)

Laters, and good luck,
Dan

----- Original Message -----
From: "Dominic Hargreaves" <dom at earth.li>
To: <oxford-pm-list at happyfunball.pm.org>
Sent: Wednesday, April 14, 2004 2:42 PM
Subject: Re: OxPM: Login modules?


> On Wed, Apr 14, 2004 at 02:23:01PM +0100, Dave Page wrote:
> > I'm writing a web script which needs to do the following: take a
> > username and password, authenticate against a backend (in this case, a
> > Postgres database), and if it's correct set a cookie, then check that
> > cookie for each subsequent page load.
> >
> > I'm sure that people have written good easy modules to do this, but I
> > don't know of any. Does anybody here have a suggestion?
>
> You'd have thought so, wouldn't you. I mean, php has this sort of
> session management built in, doesn't it? The last time I looked though I
> couldn't find anything for Perl, so do let me know if you find something
> useful.
>
> Cheers,
>
> Dom.
>




More information about the Oxford-pm mailing list