Create login_tools.php

functions that do background work in login page.