Home  >  Article  >  Backend Development  >  关于站点获取另外一个站点下的cookie有关问题

关于站点获取另外一个站点下的cookie有关问题

WBOY
WBOYOriginal
2016-06-13 11:51:241370browse

关于站点获取另外一个站点下的cookie问题
现有A,B(域名不一样)两个网站,  A网站登录后,会保存一份cookie,  这时B网站想知道A站的哪个用户登录了,即想获取这个cookie值。   

 有什么方法可以通过curl实现吗?  或者不通过curl,通过其它方式获取   
------解决方案--------------------
siteb.js

<br />$.get('sitea_api.php?salt=验证密钥&time=当前时间戳',function(){<br />      //执行登录操作<br />});<br />


sitea_api.php
<br />if(mycheck($salt)){//检查密钥是否正确<br />    echo $uid;//输出当前用户id<br />}<br />

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn