普通网友 2019-01-25 12:34
浏览 85

如何使用$ imCOIE变量访问使用<img>标签读取的cookie?

I have 2 servers viz. www.example.destination.com (destination server) and www.example.source.com (source server). I have some cookies set on destination server. I want to read those on source server. So, I have put img tag on source server like this:

img src="http://www.example.destination.com/" style="display:none;"

Now, I am able to read the cookies from destination server to source server.

I opened the URL www.example.source.com in my browser. I have checked it in my Chrome Developers tool -> Application tab. It is showing all the cookies from source server as well as destination server.

But, when I use $_COOKIE variable to access the destination server cookies in my source server php file, I am not able to get it.

So, how should I use the destination server cookies, that I have read it through img tag.

  • 写回答

1条回答 默认 最新

  • dqz84361326 2019-01-25 13:53
    关注

    Using an image source you can set cookies on your destination server, as you are basically sending a request.

    However, to read it, you need access to that domain, redirect the user there, read it and pass it on another way back to your source server like a URL parameter or something.

    评论

报告相同问题?

悬赏问题

  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型