update session if needed