How does one keep a Drupal session alive across two different URLs?

28/07/2018


I have the same drupal 7 installation running on:

www.mysite1.com

And:

www.mysite2.com

Or perhaps, another way to imagine the problem is, supposed I have two sites:

mysite.com

And:

www.mysite.com

Most people redirect mysite.com to www.mysite.com. But if you had to have them both enabled, and they run the same drupal installation, and you log into one of them, it won’t mean you are logged into the other.

Since mysite1.com is running the same code as mysite2.com, or another example, having mysite.com running the same code as www.mysite.com, I want the user to remain logged in when he switches from one to the other.

I assume Drupal stores the user’s session id and when you switch to the other site, you get a new session_id, but surely there has to be a way to make the two aware of each other, so that you can allow the user to remain logged in across two sites?

قالب وردپرس