How can I make two domain names work with a heroku app?

I have a heroku app, that is configured with two domain names. Say abc.com and www.abc.com. My problem is visiting these two domain names show me different results for authentication. Say, if I'm logged in from abc.com and then I visit www.abc.com, I will have to re-login at www.abc.com, even though I logged in from abc.com.

How can I fix this at heroku?. I am a beginner at this. Any help will be appreciated. Please do guide.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum