Allow php sessions to carry over to subdomains

前端 未结 10 1383
清歌不尽
清歌不尽 2020-11-22 01:10

I use php sessions (not cookies, except for session id cookie) for all user data, and when a user goes to their profile user.mydomain.com they are immediately \"logged out\"

10条回答
  •  眼角桃花
    2020-11-22 01:50

    I know this is quite old - but to further expand on @CTT's suggestion - I needed to add a php.ini file in each sub-directory (that will be executing php code and requires the session) of my subdomain with the following text:

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

    I hope this helps (it took me ages to figure this out).

提交回复
热议问题