PHP Sessions across sub domains

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

    Try using:

    session.cookie_domain = "example.com"
    

    Instead of:

    session.cookie_domain = ".example.com"
    

    Note the missing period at beginning.

    Be careful using this, though, because it is not supported by all browsers.

提交回复
热议问题