Fixed that the `Publish` endpoint would have a 500 error when persistent session were enabled.