Added a second log in function for AJAX to use