dadamssg Posted August 22, 2009 Share Posted August 22, 2009 ? Quote Link to comment https://forums.phpfreaks.com/topic/171369-do-sessions-work-across-subdomains/ Share on other sites More sharing options...
corbin Posted August 22, 2009 Share Posted August 22, 2009 session_set_cookie_params Can be used to make it do so. Quote Link to comment https://forums.phpfreaks.com/topic/171369-do-sessions-work-across-subdomains/#findComment-903753 Share on other sites More sharing options...
dadamssg Posted August 22, 2009 Author Share Posted August 22, 2009 do you have any idea how to use it? i don't want to set any other parameter besides the domain one. Quote Link to comment https://forums.phpfreaks.com/topic/171369-do-sessions-work-across-subdomains/#findComment-903755 Share on other sites More sharing options...
sKunKbad Posted August 22, 2009 Share Posted August 22, 2009 All you gotta do is read the page corbin showed you. The answer is right in the parameters: domain Cookie domain, for example 'www.php.net'. To make cookies visible on all subdomains then the domain must be prefixed with a dot like '.php.net'. It doesn't get any easier, except if you are hoping for us to do the work for you, and that's not gonna happen. Quote Link to comment https://forums.phpfreaks.com/topic/171369-do-sessions-work-across-subdomains/#findComment-903784 Share on other sites More sharing options...
corbin Posted August 22, 2009 Share Posted August 22, 2009 do you have any idea how to use it? i don't want to set any other parameter besides the domain one. The easiest way to do that would be to either do: ini_set('session.cookie_domain', '.yourdomain.com'); Or you could do it in php.ini or in a .htaccess file. http://us2.php.net/manual/en/session.configuration.php#ini.session.cookie-domain Quote Link to comment https://forums.phpfreaks.com/topic/171369-do-sessions-work-across-subdomains/#findComment-903803 Share on other sites More sharing options...
dadamssg Posted August 23, 2009 Author Share Posted August 23, 2009 would i put that on every page? or just my index page? Quote Link to comment https://forums.phpfreaks.com/topic/171369-do-sessions-work-across-subdomains/#findComment-904518 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.