As mentioned earlier, while occasional foamy urine is harmless, consistent foaminess, especially with symptoms like swelling, ...
We need to follow certain things in our life. Adequate hydration, even if the symptoms are very minor you need to visit your nearest urologist as soon as possible.