bogeyman Posted November 14, 2008 Share Posted November 14, 2008 Dear all, How can I use just one session for multiple domain? For example, I want to use just one session for domain domain1.somewhere.com and domain2.somewhere.com so users can navigate between those domains with just once login. Quote Link to comment Share on other sites More sharing options...
cunoodle2 Posted November 14, 2008 Share Posted November 14, 2008 I would say yes and no. Here are my ideas on ways around it.. 1. Use cookies. 2. Use a back ground process of php curl to create an instance on another page. For example if you were running in domain1.somewhere.com and then you wanted to create a session in domain2.somewhere.com you could use php's curl function to open up a page in the background and proceed from there. For example you could have a page similar to domain2.somewhere.com/newsession.php and like open that up in the background of domain1.somewhere.com. The newsession.php page would be something that the actual user would never even know about or even see. It could be used to create sessions with some pre defined data. let me know if you need anything else. Quote Link to comment Share on other sites More sharing options...
bogeyman Posted November 17, 2008 Author Share Posted November 17, 2008 Well, I got another solution. I just modify php.ini and change the line : session.cookie_domain = To (the domain name is just an example) : session.cookie_domain = .somewhere.com That means every subdomain can use the same session as long as they are under the same domain name (in this case somewhere.com) and located at the same web server. But, I think your idea is very good and I will try it. I think it can be implemented even if the domains are located at different server and have completely different domain name. Thanx. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.