Is it illegal to take a spouse off your health insurance before divorce is final?

Question Details:

We have filed for divorce but do not have a separation agreement or anything; the divorce hearing is not for months. For how long after a divorce can you keep an ex on your insurance? I heard there was a new federal law that lets you stay on with an ex's health insurance company for a couple years. I'd be happy to pay the premium myself, I just would like to keep the policy if possible. Important Notice