Hi I have 1 domains with 3 sub domains I want to share login on all 3 sub domain and main domain I am using following code and It should work. session_set_cookie_params(3600, '/', '.mydomain.com'); session_start(); PHP: Any Idea? I want to know "has it something to do with server configuration?" or its because of something else? Thanks.
To start: Whenever you change how sessions and cookies are handled, be sure to first clear your browser's stored cookies before testing. Try multiple browsers. Browser sometimes matters. If you're using IE7 or IE6 and the server name is resolved from .../etc/hosts, you might not even get a cookie set. Be sure to call those two session functions for every page/request. The settings only apply during script execution, so each script will need to call those for proper cookie+session handling and access.
hello this work for you session_start(); setcookie("PHPSESSID", session_id(), 0, "/", ".yourdomain.com"); Best