Search code examples
perlmason

What is the best way to make login session with Perl's HTML::Mason?


I'm with some difficulties in make this.

I have a login HTML form, and I want to know if the user and password match with the information in my MySQL server.

What is the best way to do it?

Thank you very much


Solution

  • Create a Mason component that validates your username/password combination against MySQL with DBI and returns true or false if it is passed username and password in the %ARGS hash. Then load the component in the top of your login form, using the return value to determine whether to show the login form or redirect to your content.