Lately I was thinking about implementing logging (as in login/password) into a website with Perl. I mean, that I want to have a dynamic website, where users can login using login and password and do some stuff.
After googling for “how to make login site” mostly PHP session solutions came up. When I added “perl” to that google query, half of results was about logging into someone’s website (wget, LWP, WWW::Mechanize etc) and not making a login feature in existing dynamic website. Search for “perl authentication” found more relevant stuff.
Some pages suggested using .htaccess. Bleh. Beside, I want to have user in a SQL database.
One result pointed to CGI::Session on cpan. Nice. CGI::Session::Auth – nice too
There is also Apache::Session to be found on cpan.
There was also a hint, to find a perl web forum script and see how it is done there. We’ll, I did it with one forum script, and found that user login and crypted password is stored in a cookie. Nice.
There also books that talk about how to do web authentication: Perl for Web Site Management or CGI programming with Perl
Here we have some design patterns: http://perldesignpatterns.com/?WebAuthentication and also: http://perldesignpatterns.com/?SessionPattern and http://perldesignpatterns.com/?PerlDesignPatterns . Even nicer
But I still look for ultimate “how to” with examples about authorizing users (register, login, remind password etc.) into some kind of dynamic website with Perl. Any hints?
See also:
- Website authorization – my solution
- Masons and mason
- Perl WTFs – last in function
- Utf8 in web perl application (LAMP) – dbi, mysql
- Utf8 in web perl application (LAMP)


If you are working with Catalyst then I would recommend http://search.cpan.org/~flora/CatalystX-SimpleLogin-0.01/ It’s just the first version released and we have still a lot of changes to it in out heads – but the core functionality should be already stable enough, and if something does not work for you – then the dev team is very responsive (I promise to be:).