PHP 中的 setcookie 会导致多个“Set-Cookie”吗?标题?
我正在调试 Magento 系统的问题。
问题是重复的 Set-Cookie 标头,如下所示:
Set-Cookie: flimmit_session=search-0c30086b812519b006aa27ef4f37f15b-24; path=/; domain=.flimmit.com; httponly
Set-Cookie: flimmit_session=search-0c30086b812519b006aa27ef4f37f15b-24; path=/; domain=.flimmit.com; httponly
cookie 是使用 php 的 setcookie 命令设置的。我的问题是,错误使用此函数是否会导致重复的 Set-Cookie 标头,或者我是否必须在其他地方查找错误......
I am debugging an issue with a Magento system.
The problem is a duplicated Set-Cookie header, like this:
Set-Cookie: flimmit_session=search-0c30086b812519b006aa27ef4f37f15b-24; path=/; domain=.flimmit.com; httponly
Set-Cookie: flimmit_session=search-0c30086b812519b006aa27ef4f37f15b-24; path=/; domain=.flimmit.com; httponly
The cookie is set using php's setcookie command. My question is whether the incorrect use of this function can result in a duplicate Set-Cookie header, or whether I have to look somewhere else for the error...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,使用相同的数据调用
setcookie()
两次将产生 2 个相同的Set-Cookie:
标头。我刚刚尝试过,确实如此。不过,它不应该引起问题,cookie 始终具有最后一次
setcookie()
调用定义的值...Yes, calling
setcookie()
twice with the same data will result in 2 identicalSet-Cookie:
headers. I have just tried it, and it does.It shouldn't cause a problem though, the cookie will always have the value defined by the last
setcookie()
call...