[prog] session management with Perl CGI scripts

Elizabeth Barham lizzy at soggytrousers.net
Wed Jul 2 13:32:23 EST 2003


Dan writes:

> Does anyone know of a simple program that demonstrates session
> management (over the web) in Perl? For example, a CGI program where
> you have to login?
> 
> What I'm particularly interested in is how automated the system
> is. I think I noticed somewhere a module that makes it easy to
> maintain data associated with a session. Does anyone know what this
> module might be?

Apache::Session::MySQL maybe?

   http://search.cpan.org/search?query=session&mode=module

   As I recall, Apache::Session sets up a hash which it associates
with the client similar in nature to the 'tie' mechanism.  There
probably is some kind of 'login' module available for perl but I'm not
aware of one. I wrote a web-app that had login, etc. and basically its
a matter of authenticating them and then storing that they've been
authenticated in the session data. Of course, it needs to eventually
timeout so you can have a column that is "last hit" and then later on
automatically log them out after a certain amount of inactivity (24
hours or what not) - this can be done with a simple SQL command.

Elizabeth


More information about the Programming mailing list