On login success && logout function