I have a website at lets say - abc.com
Whenever, a user hits abc.com
, I redirect him (using an index.php) to abc.com/home.php
. Now a user can login on this page, and go around with his work.
Problem comes, when someone explicitly types www.abc.com
in a new tab, the code still works and he is still being redirected, but the user is treated as non loggedin user. even though he just logged in earlier in a previous tab.
I don't know the cause of this problem, and how can I resolve this. I do know that my servers have virtual hosts setup in apache that direct my requests to /var/www/html/abc
Can I solve this by htaccess redirect? Or do I have to make changes in my virtual host settings?
EDIT
Solution at - Allow php sessions to carry over to subdomains
Dont forget to close your browser and open it again, after you restart your server after making change in php.ini