Oluwa, I remember others posting that "foamy urine" was an indicator of kidney issues. Hopefully Saysusie or one of the others with similar experiences will jump in on this.
Or could it be a reaction from the meds you took to get rid of the UTI???
Hugs - and hope all is OK.