PHP Can't read cookies?

前端 未结 4 1454
轮回少年
轮回少年 2021-01-22 12:03

I like to use PHP to see if a cookie PHPSID27258STATUS is present with the value COMPLETE en if so do stuff.

In google chrome (in Options) I ca

4条回答
  •  囚心锁ツ
    2021-01-22 12:14

    You can only read cookies which belong to the same domain as the reading script. For instance if the cookie PHPSID27258STATUS was set by domain xyz.com, you can not read it using a script on abc.com. So make sure the domain of your desired cookie is the same. Also show us the code part where you are setting your cookie.

    Edit:

    setcookie($cookiename, "COMPLETE", (time() + 31536000) , '/');
    

提交回复
热议问题