Update the user session based on the context