Logic of login page