ajax logins and logouts working