启用 pecl_http 请求池 cookie 持久性
我正在尝试为发送的 pecl_http HttpRequest 对象启用 cookie 持久性,使用相同的 HttpRequestPool 对象发送(如果重要的话);不幸的是,文档非常稀缺,尽管我做了所有尝试,但我认为事情无法正常工作。
我尝试过使用 HttpRequestDataShare(尽管这里的文档非常)和使用“cookiestore”请求选项来指向文件。我仍然没有看到 cookie 在连续请求中发送回服务器。
需要明确的是,“cookie 持久性”是指服务器设置的 cookie 会自动存储并由 pecl_http 在连续请求中重新发送,而无需我手动处理(如果涉及到的话,我会的,但我希望我不必这样做)。
任何人都可以向我指出一个工作代码示例或应用程序,该示例或应用程序将多个 HttpRequest 对象发送到同一服务器并利用 pecl_http 的 cookie 持久性吗?
谢谢!
I'm trying to enable cookie persistence for a sent of pecl_http HttpRequest objects, sent using the same HttpRequestPool object (if it matters); unfortunately documentation is quite scarce, and despite all my attempts I do not think things work properly.
I have tried both using HttpRequestDataShare (albeit documentation here is very scarce) and using the 'cookiestore' request option to point to a file. I still do not see cookies sent back to the server(s) in consecutive requests.
To be clear, by "cookie persistence" I mean that cookies set by the server are automatically stored and re-sent by pecl_http on consecutive requests, without me having to manually handle that (if it comes to it I will, but I am hoping I don't have to do that).
Can anyone point me to a working code sample or application that sends multiple HttpRequest objects to the same server and utilizes pecl_http's cookie persistence?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请注意,请求池尝试并行发送所有请求,因此它们当然无法知道尚未收到的 cookie。例如:
Mind that the request pool tries to send all requests in parallel, so they cannot know cookies not yet received of course. E.g.: