duanmin0941 2019-04-18 10:53
浏览 192
已采纳

如何从同一个浏览器收集一个域的相同cookie到另一个域?

I have opened an anonymous website say example.com in a browser. Now I am running a PHP script which runs in another domain say test.com which is owned by me in another Tab from the same browser. How can I get all the cookies which were set in example.com into my test.com PHP script? The objective is to collect all the same cookies that were set in example.com & process those same cookies in my PHP script.

Any advice would be much appreciated?

  • 写回答

1条回答 默认 最新

  • doubaben7394 2019-04-18 10:54
    关注

    You cannot get cookie information from one domain to another. It would be a massive security hole.

    If you absolutely need the values, you will need to add a page to domain1 which reads the cookie and redirects to domain2, passing the cookie values as a query string or form parameter.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 西门子S7-Graph,S7-300
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改