PHP Sessions across sub domains

前端 未结 17 1660
慢半拍i
慢半拍i 2020-11-22 05:59

I am trying to set up the following:

auth.example.com
sub1.example.com
sub2.example.com

If the user visits sub1.example.com or

17条回答
  •  时光取名叫无心
    2020-11-22 06:31

    One thing which can mysteriously prevent session data being read on a subdomain, despite cookies being correctly set to .example.com is the PHP Suhosin patch. You can have everything configured correctly, as per the examples in the question, and it can just not work.

    Turn the following Suhosin session settings off, and you're back in business:

    suhosin.session.cryptua = Off 
    suhosin.session.cryptdocroot = Off
    

提交回复
热议问题