Sharing php Session ($_SESSION) across multiple domain

后端 未结 5 1062
轻奢々
轻奢々 2020-12-06 08:53

I have 2 different domain, let\'s call them www.foo.com and bar.foo.com. The first one is built with CI, and the second one is built with Symfony. I want to share my session

5条回答
  •  甜味超标
    2020-12-06 09:20

    Sessions are associated with actual files in the server which contains the session data. So unless the sites have a way of sharing these temporary session files, then they can't share sessions. That is unless the session is serialized and sent the other site. I think the only solution is to implement a session that gets and stores the session data in an external database that the two sites have access to. Then if server 1 sends the session ID to server 2 and server 2 uses it to access the database, it can access the session data stored by server 1

提交回复
热议问题