Added error checking to the user login and now using Session variables

Added session variables and error checking.