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

注销session后,再执行一次WebsocketService.php的onOpen事件,session又会回来 #44

Closed
eiixy opened this issue Jun 4, 2018 · 2 comments

Comments

@eiixy
Copy link

eiixy commented Jun 4, 2018

  1. Tell us your PHP version(php -v)

php 7.1.7

  1. Tell us your Swoole version(php --ri swoole)

swoole 2.0.12

  1. Tell us your Laravel/Lumen version(check composer.json & composer.lock)

laravel 5.6.2

  1. Detail description about this issue(error/log)

_27o 7p7tkusw5jwl9hr

1.登陆后打开websocked连接页面触发onOpen事件
pp5 g _phmp oh h5 fxo
2.注销用户登录(注销后后台首页已经不能访问了)
z54k0 nmydacq4u4rk xt1
3.重复打开websocked连接页面触发onOpen事件
4.打开后台首页(此时又能正常访问),session又有了
1 m7 306fao 3f 575

感觉是Laravel的session清除后,onOpen事件中开启的Laravel生命周期还在,刷新一下连接又恢复原来的session了

@hhxsv5
Copy link
Owner

hhxsv5 commented Jun 5, 2018

应该是跨worker进程导致的问题。Http和Websocket在不同的worker进程中各自加载了Session,Http Worker进程中清理Session后,Websocket进程读取的还是之前加载在内存里的Session。

@hhxsv5
Copy link
Owner

hhxsv5 commented Jun 7, 2018

已修复。

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

2 participants