如何使用PHP访问同一域的不同路径上的cookie值? [英] How to access cookie values on different paths of the same domain using PHP?

查看:122
本文介绍了如何使用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.

这篇关于如何使用PHP访问同一域的不同路径上的cookie值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆