带有 cookie 的鱿鱼 url_rewrite
我部署了一个鱿鱼 3.0,它有一个 url_rewriter 程序,可以重写某些 HTTP 请求。 我现在需要修改这个prpogram以与cookie设置代码一起重写。
据我看过 url_rewrite_program 文档,看来我可能无法随 302 响应一起设置 cookie。
这是正确的吗? 我可以在重定向响应中设置 cookie 还是需要修改鱿鱼代码。
感谢这方面的任何帮助!
I have a squid 3.0 deployed which has a url_rewriter program which rewrites certain HTTP requests.
I now need to modify this prpogram to rewrite along with the cookie setting code.
As much as I have seen the url_rewrite_program documentation, it appears that I may not be able to set a cookie along with the 302 response.
Is this correct?
Can i set a cookie in the redirect response or would this require modifying the squid code.
Appreciate any help in this regard!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
邮件列表确认 url_rewriter 和squid 协议截至今天不支持设置cookie。
我自己修改了鱿鱼代码来做到这一点
现在,您可以通过从 url_rewriter 程序返回以下行来设置 cookie
302:#
例如
302:http://my.example.net #cookie_name=cookie_value;path=1;expiration=+300
一个警告(更多关于我自己的文档),
您不能在 cookie 字符串中放置空格,因为鱿鱼读取函数会拒绝空格后面的任何内容。
有谁对补丁感兴趣请告诉我
Mailing list confirmed that url_rewriter and squid protocol as of today does not support setting the cookie .
I have modified the squid code myself to do this
Now you could set the cookie by returning the following line from your url_rewriter program
302:<URL>#<SET_COOKIE>
for example ,
302:http://my.example.net#cookie_name=cookie_value;path=1;expiration=+300
One caveat (more for my own documentation),
you cannot place a space in the cookie string as the squid reading function rejects anything after a whitespace.
Anybody interested in the patch ,let me know