如何使用PHP访问同一域的不同路径上的cookie值?

问题描述:

可以将路径的参数添加到$ _COOKIE []?

Can a parameter of path be added to $_COOKIE[]?

对于与当前相同的域上的不同路径,这是不可能做到的。浏览器本身限制了这一点,并且只发送适合当前路径的cookie。

In case you are trying to access cookies set for a different path on the same domain than the current, that can't be done. The browser itself restricts this, and only sends the cookies appropriate for the current path.