0

So I recently moved to a new web host (OVH). The website and domain have been moved over 4 days now...

We are noticing an issue with sessions not being persistant across the website. It seems that if someone logs into the website at this url http://examplesite.com a PHP session is stored, but if they then try to visit the website at http://www.examplesite.com the php session does not work because of the www.... Like wise if we were to login to the www domain the non-www domain wouldn't be logged in....

Anyone know what the heck is going on here?

Ricky
  • 823
  • 2
  • 14
  • 31
  • Can you post your code here? There may be a lot of reasons. – Panda Jun 04 '16 at 02:37
  • 1
    Possible duplicate of [PHP: SESSION lost on SUBDOMAIN](http://stackoverflow.com/questions/7324822/php-session-lost-on-subdomain) – Jebediah Jun 04 '16 at 02:38
  • @Jebediah I looked into that article and the solutions posted there did not help me.... I tried them both and they didn't work. – Ricky Jun 04 '16 at 03:03

1 Answers1

0

Anyone having this issue, I was able to fix it by writing htaccess re-write rules so that it simply redirects all traffic to www.mysite.com to mysite.com

Ricky
  • 823
  • 2
  • 14
  • 31