0

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

zookastos
  • 917
  • 10
  • 37
  • What is the domain for your session's cookie? – Spoody Jan 17 '18 at 22:05
  • 4
    Possible duplicate of [Allow php sessions to carry over to subdomains](https://stackoverflow.com/questions/644920/allow-php-sessions-to-carry-over-to-subdomains) –  Jan 17 '18 at 22:07
  • @rtfm: I tried the solution in the link above, and modified my php.ini file. The problem is still there. – zookastos Jan 17 '18 at 22:55
  • Sorry my bad. That fixed it. I had to close the browser and open it again. – zookastos Jan 17 '18 at 23:04

0 Answers0