corillo181 Posted May 12, 2008 Share Posted May 12, 2008 how can i make my sessions work with subdomians? i thought a sub wa sjust another folder, but i see it doesn't work like that any tips? Link to comment https://forums.phpfreaks.com/topic/105296-subdomains/ Share on other sites More sharing options...
revraz Posted May 12, 2008 Share Posted May 12, 2008 sessions are domain specific. Even www.mysite.com isn't the same as mysite.com Link to comment https://forums.phpfreaks.com/topic/105296-subdomains/#findComment-539204 Share on other sites More sharing options...
corillo181 Posted May 12, 2008 Author Share Posted May 12, 2008 ok so any help on how to move session between a.com and b.a.com Link to comment https://forums.phpfreaks.com/topic/105296-subdomains/#findComment-539212 Share on other sites More sharing options...
NorthWestSimulations Posted May 12, 2008 Share Posted May 12, 2008 A way you can do it is not sessions but have data stored in a cookie and have a MySQL database page the cookie. Then have both of your sites running on the same database then the connections and session_data will be called from one another Link to comment https://forums.phpfreaks.com/topic/105296-subdomains/#findComment-539213 Share on other sites More sharing options...
PFMaBiSmAd Posted May 12, 2008 Share Posted May 12, 2008 You need to set the session.cookie_domain. From the cookie section of the php manual - domain The domain that the cookie is available. To make the cookie available on all subdomains of example.com then you'd set it to '.example.com'. The . is not required but makes it compatible with more browsers. Setting it to www.example.com will make the cookie only available in the www subdomain. Link to comment https://forums.phpfreaks.com/topic/105296-subdomains/#findComment-539247 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.