fix issue when saving encoded path in browser document cookie