Hey guys, I have a problem and I am calling it 'Session splitting' since I have no other way to put it. When a user logs in on my website by visiting www.mywebsite.com the cookie will be stored for www.mywebsite.com . It does not store the cookie for mywebsite.com (without the www). How can I fix this? thx
The cookie name is defined within your web evironment. Modify it to what you want, or you can change it in your web script.
I think my webserver thinks business-web.org en www.busines-web.org are two different domains, and does therefore disallows access to 'both' session cookies. How can I get my webserver to think that business-web.org and www.business-web.org are the same thing? I tried ini_set('session.cookie_domain', '.business-web.org'); Code (markup): but that's not working. Any other ideas on this matter? thx [edit] Weird, the code above does work on a different PC. Although I have removed the session with sessn_destroy, it looks like there are still some remains. Aaah, no problem, it works
If you set a cookie then use this: setcookie("session_name", $var, time()+3600, "/", ".mywebsite.com");
What you are describing isn't a 'bug' you can fix, it's a feature. www.yourdomain.com and yourdomain.com ARE in fact two different sites, for security, cookies are not meant to work cross border. Just picture the trouble that would cause on sites like blogspot. Just 301 all www to non www or the other way around and consistently link to one, not the other.