Hi,

I am getting problem in PHP SESSION management. Let me to explain the problem.I have a PHP Web Server (Win 2000, IIS) and having more than 10 php web sites configured on it. If i use the URL

[url]http://www.mysite_1.com[/url]
[url]http://mysite_1.com[/url]

with and without 'WWW', PHP create two different session_id() instead of one unqiue and i lost the data during client navigate from one page to another.

I do not want to use the session_set_cookie_params (0,'/','.mysite_1.com') because i have to change in many PHP pages and web server has many php sites using session.

If i use the PHP.ini to set the "session.cookie_domain" then again this will be for one domain not for all the domains configured on the server.

Can u please solve my problem that how can i overcome this PHP SESSION ID global for subdomains of a single domain for all the sites running on the PHP web Server?

Regards,
Imran Khalid
PHP Developer
http://imrankhalid.5u.com

    Set session.cookie_domain in php.ini to '.domain.tld', and it should carry over. Note the dot at the beginning.

    If not, you're up a creek.

      Hi,

      I have tried with Set session.cookie_domain in php.ini to '.domain.tld', and it did not work and solve my problem. PHP was taking it as a domain not as patteren matching (global for all sub domains)

      If is set it to a particual domain then its work fine but all others top level domains stop working.

      For example

      //php.ini
      session.cookie_domain = .mysite_1.com
      

      works fine but [url]http://www.mysite_2.com[/url] session stop working. and below not working for any site.

      //php.ini
      session.cookie_domain = .domain.tld
      
        Write a Reply...