Period UTI

So the last two times I have gotten my period I have gotten a bladder infection as soon as I start and it stops as soon as I stop my period Anyone got any clue why ? I know I should go to the doctor btw