How do you get a cookies params? The "expire, secure, httponly" etc.
Is it possible?

在PHP中获取cookie参数?
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
3条回答 默认 最新
- dongsonghen9931 2010-07-04 08:18关注
There isn't a way to get when a cookie is set to expire or any of the other parameters you are asking for using PHP. This is because PHP doesn't store anything like that, when you are setting a cookie, you are basically saying to output a header to the browser only once, then it's the job of the client (a browser) to send back the cookie data on each HTTP request. PHP therefore has no reason to retain the data, so it doesn't.
You can of course store when the cookie will expire in another cookie or a file somewhere, if you know where in your code the cookies are being set.
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报