2019-04-18 10:53


  • cookies
  • php
  • curl
  • browser

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?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答


  • doubaben7394 doubaben7394 2年前

    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.

    点赞 评论 复制链接分享