Coincidence

Has anyone had reoccurring uti’s and come off birth control pills and not had anymore? Is this a coincidence or is this an actual thing? I had them for over a year constantly and suddenly they’ve stopped?