redirect to previous page on login/logout