adding ajax login and logout