php - Why can't I pass user sessions between subdomains? -
First of all, I have used all the methods suggested in this article:
The feature, Here are the suggestions I have already made:
There are 3 options here.
Put it in your php.ini:
session.cookie_domain in your .htaccess:php_value session.cookie_domain .example.com< P> As the first thing in your script:ini_set ('session.cookie_domain', '.example.com'); I have 9 subdomains (losangeles.mysite.com, sandiego.mysite.com, etc.), and I want users to be signed between them. So far, however, the server is treating each subdomain as a completely site with different sessions.Can I do anything else? Or how can I get rid of it?
I suspect cookies are being set for .foo.example.com. Instead of trying to install live HTTP headers add-ons for .example.com Firefox, and check how cookies are set up.
To do this, open open HTTP headers and windows, go to the page that sets cookies, in the window, there should be a line that looks like this.
Set-cookie: LNG = N-US; Path = /; Domain = .example.com;
If the cookie is set to domain = .foo.example.com; So you know what the problem is, however, if the domain is .example.com, then something else is going on.
In addition, if cookies are set to .example.com on Fu .example.com, to see if the browser is sending cookies to bar.example.com. This should help in resolving the problem.
Comments
Post a Comment