Fix user model. Store session and log in the user