Page 1 of 1
session IDs and multiple domains on one site
Posted: Tue Apr 20, 2004 11:36 am
by Big Dog
I have one site which uses multiple domain names and multiple directories. When someone moves to a different dir and domain on the site they have to re-register because the session id is no longer available. If they move back to the previous domain, the old session variable is still active. The session ID seems to be tied to one domain (I believe) Is there a way to keep the same session ID over all directories and domains on the one site?
Posted: Tue Apr 20, 2004 11:37 am
by malcolmboston
you could use cookies as a go between for the domains
Posted: Tue Apr 20, 2004 11:39 am
by magicrobotmonkey
or hidden form fields
Easy solutions ...
Posted: Tue Apr 20, 2004 3:09 pm
by Big Dog
I was hoping there was a setting in php.ini that I could change to relax the domain condition. I don't have access to my php.ini, so I can't experiment, whatever I tell the sysadmin I have to be pretty sure about.
Posted: Tue Apr 20, 2004 3:30 pm
by redmonkey
Code: Select all
ini_set('session.cookie_domain', '.yourdomain.com');
Should make the session available to everything at yourdomain.com
e.g.
http://www.yourdomain.com
forums.yourdomain.com
shop.yourdomain.com
yourdomain.com