SPUG: Perl CGI session authentication

Colin Meyer cmeyer at helvella.org
Fri Dec 12 08:04:54 PST 2008


I'd suggest looking to your web application framework for this
functionality.

I use Catalyst. To achieve user login with expiring sessions, you need
three plugins: Authentication, Authentication::Store::DBIx::Class and
Session. It is fairly easy to configure everything. This takes care of
everything, including authenticating credentials against a database,
maintaining the session cookie and server side state data. The basics
are spelled out in the Catalyst manual:

  http://search.cpan.org/~rjbs/Catalyst-Manual-5.7014/lib/Catalyst/Manual/Tutorial/Authentication.pod

There are similar plugins for the other popular web app frameworks.

-Colin.


On Fri, Dec 12, 2008 at 12:05:53AM -0900, Christopher Howard wrote:
> Hi. I'm about to code the admin interface for this little music database 
> web app I'm working on. I need to decide how I want to handle the 
> authentication for the admin who logs in. In the past I've used .htaccess 
> files for httpd authentication, but I was thinking I would like to do 
> authentication with CGI this time. That is, sending the password over CGI, 
> then having a session ID generated, storing a session ID in a cookie, and 
> that sort of thing.
> 
> Is there any cool modules or packages which make that sort of thing fairly 
> easy? Most of it doesn't sound too hard... however, keeping track of the 
> sessions and session IDs sounds kind of complicated.
> 
> I didn't want anything real complicated... But I've seen Perl blog 
> software like Moveable Type, which stores the 
> password in a config file, and doesn't utilize .htaccess-style 
> authentication. (I'm trying to look through the Moveable Type code to see 
> how they do it, but their code is pretty complicated and I haven't even 
> figured out where to look yet.)
> 
> I've done a fair amount of googling, but I'm having trouble narrowing down 
> the search to what I'm looking for.
> 
> --
> Christopher Howard
> choward at indicium.us
> http://www.indicium.us
> _____________________________________________________________
> Seattle Perl Users Group Mailing List
>     POST TO: spug-list at pm.org
> SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list
>    MEETINGS: 3rd Tuesdays
>    WEB PAGE: http://seattleperl.org/


More information about the spug-list mailing list