PHP Shared Sessions across Domain

≯℡__Kan透↙ 提交于 2019-11-30 20:10:29

Have you thought about using session_set_save_handler. You can store your sessions in a database and access them from any domain.

  1. Define a main session server (I do this in combination with memcached)

  2. use Ajax / JSON(P) to request a session from this server, this allows you to share sessions over multiple domains

  3. Reuse this session

bigstylee

For the benefit for anyone else interested in this functionality, there is no simple answer I am afraid. Google "Single Sign On" and it will come back with the technology and some solutions avialable.

As for using htaccess to hide the domain name, this is not possible as it could be used for malicious activities.

I have now successfully implemented a system to achive my requirements.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!