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? Quote Link to comment 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. Quote Link to comment 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. 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.