processing login and logout requests