Home  >  Article  >  Backend Development  >  关于 UCenter uc.php 中同步接口的问题

关于 UCenter uc.php 中同步接口的问题

WBOY
WBOYOriginal
2016-06-06 20:08:37967browse

我想做的是实现 ThinkPHP 与 Discuz 的用户同步登陆注销。
由于时间紧张,加上之前没接触过 Discuz,所以是直接在 Discuz 的 uc.php 中额外增加验证分支去调用 synlogin、synlogout 方法的,然后在 ThinkPHP 中通过 CURL 进行接口调用。

但是现在出现的问题就是:CURL 接口调用能成功执行用户状态 Cookie 值的设置,但是实际上 Cookie 没有被设置到 Discuz 上;如果是用相同的请求头、请求方法通过浏览器去访问接口就可以成功设置上 Cookie
想请教一下是哪里出了问题导致 CURL 的接口无法成功设置 Cookie

回复内容:

我想做的是实现 ThinkPHP 与 Discuz 的用户同步登陆注销。
由于时间紧张,加上之前没接触过 Discuz,所以是直接在 Discuz 的 uc.php 中额外增加验证分支去调用 synlogin、synlogout 方法的,然后在 ThinkPHP 中通过 CURL 进行接口调用。

但是现在出现的问题就是:CURL 接口调用能成功执行用户状态 Cookie 值的设置,但是实际上 Cookie 没有被设置到 Discuz 上;如果是用相同的请求头、请求方法通过浏览器去访问接口就可以成功设置上 Cookie
想请教一下是哪里出了问题导致 CURL 的接口无法成功设置 Cookie

你去discuz官网看下开发手册吧,里边的ucenter 就支持同步登陆登出
http://www.comsenz.com/downloads/install/ucenter

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