Adding the code for user login event and updating the last login time