vicodin Posted November 8, 2008 Share Posted November 8, 2008 i have a site where if it doesnt have the www infront of it the session will fail... i know why its failing, the site redirects it to a page that has www infront of it and sessions cant get passed between domains so how do i stop that? Link to comment https://forums.phpfreaks.com/topic/131874-session-fails-without-www/ Share on other sites More sharing options...
ratcateme Posted November 8, 2008 Share Posted November 8, 2008 why don't you just have all your pages setup to redirect to www.yourdomain.com that solves the problems plain and simple Scott. Link to comment https://forums.phpfreaks.com/topic/131874-session-fails-without-www/#findComment-685099 Share on other sites More sharing options...
PFMaBiSmAd Posted November 8, 2008 Share Posted November 8, 2008 www is not a domain it is a hostname/subdomain (whoever at php.net that decide to refer to it as a "domain" in the cookie settings, obviously did not understand fully what they were doing.) To allow the session cookie to work for a hostname/subdomain that is different than where it was set, you must set the session.cookie_domain parameter. The session_set_cookie_params() section in the php manual shows and example of how to do this so that the cookie will match all hostnames/subdomains of your domain. Link to comment https://forums.phpfreaks.com/topic/131874-session-fails-without-www/#findComment-685248 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.