PHP Shared Sessions across Domain

前端 未结 3 1102
花落未央
花落未央 2021-01-05 09:26

I have seen a few answers to this on SOF but most of these are concerned with the use of subdomains, of which none have worked for me. The common one being that the use of

相关标签:
3条回答
  • 2021-01-05 09:54

    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.

    0 讨论(0)
  • 2021-01-05 09:59

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

    0 讨论(0)
  • 2021-01-05 10:14
    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

    0 讨论(0)
提交回复
热议问题