in reply to user/session managment

You are there. Just read the POD of CGI::Session. It includes support for MySQL.