Adding log in/out functionality and securing the database queries.