Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

用户授权登录问题 #481

Closed
tomhaoye opened this issue Aug 4, 2016 · 13 comments
Closed

用户授权登录问题 #481

tomhaoye opened this issue Aug 4, 2016 · 13 comments

Comments

@tomhaoye
Copy link

tomhaoye commented Aug 4, 2016

我用的环境

PHP 版本:5.6
overtrue/wechat 版本:3.0

问题及现象

用户授权登录回调时获取用户信息有时候会抛出invalidstateexception,有时候获取到的用户信息为null,错误日志中发现该问题,多次尝试不能复现,暂不清楚是用户操作流程问题还是其他问题。

@tomhaoye
Copy link
Author

tomhaoye commented Aug 4, 2016

貌似有时候获取access_token也失败

The key "access_token" could not be empty.

@overtrue
Copy link
Collaborator

overtrue commented Aug 4, 2016

@tomhaoye oauth 协议是不能在失败页面刷新的,刷新就必然是 "The key "access_token" could not be empty."

第一个问题应该是你的 sessionid 丢失造成的。

@tomhaoye
Copy link
Author

tomhaoye commented Aug 4, 2016

Invalid state exception是获取code的时候抛的异常吧,这个也跟我的sessionid有关吗?

@overtrue
Copy link
Collaborator

overtrue commented Aug 4, 2016

@tomhaoye state 使用 session 存储

@tomhaoye
Copy link
Author

tomhaoye commented Aug 4, 2016

@overtrue 噢看到了,谢谢,我先再看看吧😄。

@tomhaoye
Copy link
Author

tomhaoye commented Aug 5, 2016

我感觉除了过了时间回收,服务器的session丢了几率没多大,更像是微信浏览器的cookie丢了,暂时我只能捕获异常再去处理了。

@overtrue
Copy link
Collaborator

overtrue commented Aug 5, 2016

@tomhaoye 嗯,我也同意,大部分可能是微信浏览器的问题。

@tomhaoye
Copy link
Author

tomhaoye commented Aug 5, 2016

@overtrue 回复真快,棒棒的
另外有某些时候会出现

cURL error 28: Operation timed out after 0 milliseconds with 0 out of 0 bytes

对应我找到的一个issue不知道是不是有关: curl/curl#619

@overtrue
Copy link
Collaborator

overtrue commented Aug 5, 2016

应该是你的服务器请求微信 API 的时候网络抖动吧。

@tomhaoye
Copy link
Author

tomhaoye commented Aug 5, 2016

嗯,出现几率很低,感觉也跟网络问题有关,谢谢啦😄

@overtrue
Copy link
Collaborator

overtrue commented Aug 5, 2016

不客气

On 周五, 8月 5, 2016 at 11:10 上午, yiweiq [email protected] wrote:
嗯,出现几率很低,感觉也跟网络问题有关,谢谢啦😄


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub [https://github.com//issues/481#issuecomment-237744774] , or mute the thread [https://github.com/notifications/unsubscribe-auth/ABZ3YLUsGGeSmRaLl2ndgsVn2FwprRE5ks5qcqm8gaJpZM4JcQxK] .

@tomhaoye tomhaoye closed this as completed Aug 5, 2016
@Hexor
Copy link

Hexor commented Jan 9, 2017

php7.08 laravel 5.2

网络条件不好的时候 服务器请求微信API的时候 就会报

ConnectException in CurlFactory.php line 186:
cURL error 28: Operation timed out after 0 milliseconds with 0 out of 0 bytes received (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

@overtrue
Copy link
Collaborator

overtrue commented Jan 9, 2017

@Hexor 那你的意思是?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants