开发者

How to Display Cookies?

I have setted some cookies in example.com/place1. When I iterate over $_COOKIE... it displays all cookies for my domain. Even those t开发者_StackOverflowhat are setted in example.com/place2. Is it possible to display cookies that are setted only in example.com/place1/*?


You'll want to set the path in which the cookie is available when you're sending it to the client. For example, on example.com/place1, set the cookie like this:

setcookie($name, $value, 0, '/place1/');

That way, the cookie will only be available inside example.com/place1/*.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜