If I live in CT but worked in RI, do I have to pay taxes for both states?

I worked in RI and they withheld RI state tax and RI SDI. No CT taxes were withheld, so I probably have to pay CT state tax. Do I have to pay both or how does this work?