improve handling of persisted sessions