In old days they threw it out the windows. Would not surprise me if they still did.
Yes, that was what gutters were for on the sides of cobblestone streets. The maids would empty the chamber pots out the window every morning, and in due course the rain would wash it down into the sewers, and into the river.
The Thames and the Hudson were pretty smelly.