directing logins and logouts