3.x.com: can session4.xyun be set to get the session through session_id? why can't I get the session? how can I set 3.x.com?
Set session
4. can xyun get the session through session_id?
Why cannot I obtain
How to set
Reply content:
3.x.com
Set session
4. can xyun get the session through session_id?
Why cannot I obtain
How to set
It depends on whether you are using different subdomains of the same domain name or different domain names. if you are using the former, you only need to set the domain parameter of CookieExample.com(Top-level domain name), you can get Session_id under other subdomains. if it is the latter, it involves SSO (single sign-on). This is complicated, this mainly involves the Session implementation principle, it is recommended to refer to: https://www.zhihu.com/question/19779937
@ Leiliang520130 and @ mestang only implement cross-server, and there is no dime relationship between cross-origin with Session.
You can put the session in redis, and connect to the same redis under two different domain names to set a get
You can use memcached or redis to store sessions in php. ini, so that the session can be stored across servers. Implementation is very simple.