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

WBOY
Release: 2016-06-23 14:00:46
Original
1748 people have browsed it

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

 有什么方法可以通过curl实现吗?  或者不通过curl,通过其它方式获取   


回复讨论(解决方案)

A网站做个接口,B直接读接口不就可以了...弄到客户端去干么呢

A网站做个接口,B直接读接口不就可以了...弄到客户端去干么呢  麻烦,能说的详细一点吗

siteb.js

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


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

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template