Add function to store users log-in or log-out

delete some useless codes