User login and logout using ajax requests.