PHP Sessions across sub domains

前端 未结 17 1467
慢半拍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:18

    I had a similar problem, however, this solution was good for me, perhaps will help others in the future

    edit the php.ini

    session.cookie_domain = ".example.com"

    the magic is here

    suhosin.session.cryptdocroot = Off
    
    suhosin.cookie.cryptdocroot = Off
    

    https://www.sitepoint.com/community/t/sessions-across-subdomains-domain-com-phpsessid-changes/3013/19

提交回复
热议问题