PHP Cookies for multiple Domains

前端 未结 5 1750
野的像风
野的像风 2020-12-09 06:54

I want to create a cookie from one domain once the user is registered in PHP. and make this cookie accessible to 4 other domains not subdomain. I know that cookies are not d

5条回答
  •  失恋的感觉
    2020-12-09 07:20

    As you have already said, a cookie can only be set for a domain from that domain (including its subdomains). And if your domains do not share a common superdomain, you need set each cookie for each domain separately.

    You can do this with a script that on each domain that sets the cookie for you. But make sure to authenticate requests to these scripts so that only you can set the cookies.

提交回复
热议问题