(CNN) -- Illinois' state Senate approved legislation Wednesday that will give same-sex couples many of the same rights as married couples.

The Illinois Religious Freedom Protection and Civil Union Act defines "civil union" as a legal relationship between two people of either the same or opposite sex.

According to the language of the bill, it will provide "adequate procedures for the certification and registration of a civil union and provide persons entering into a civil union with the obligations, responsibilities, protections, and benefits afforded or recognized by the law of Illinois to spouses."

Gov. Pat Quinn, a Democrat, pledged in his recent re-election campaign to sign the bill.

The state House approved the measure Tuesday.

The legislation deals with the rights of couples regarding wills, shared financial assets, end-of-life decisions and visitation of a critically ill partner.

CNN's Kara Devlin and Bill Mears contributed to this report.