Some works in login/logout process