I create two application, let say my first application called mastersite, and the second application called childesite. I store the childesite project under the mastersite project directory.
I create virtual host in my apache server, and the document root of the directory point to masterproject directory supposed the virtual host name is http://www.mastersite.com. after that i create sub domain of virtual host supposed the subdomain of virtual host name is, http://www.childesite.mastersite.com.
while http://www.mastersite.com is opened by a browser, the application stored the dummy data to its session. Supposed I name it to dummy_data, and the dummy_data set to ‘123’. dummy_data = ‘123’;
while http://www.childesite.mastersite.com is opened, it will read the dummy_data from the mastersite.com domain and print out the dummy_data to the browser. but The http://www.childesite.mastersite.com is blank, because it can’t read the domain session.
but, if i try open the childesite using http://www.mastersite.com/childesite the dummy data will be printed out to the browser.
why these thing could by happened ?
Before initializing session put this line:
For more information:
http://www.php.net/manual/en/session.configuration.php#ini.session.cookie-domain
http://www.php.net/manual/en/function.session-set-cookie-params.php
http://www.php.net/manual/en/function.session-get-cookie-params.php