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 对象不能序列化吗? #30

Open
jianglrelia opened this issue Mar 4, 2019 · 4 comments
Open

session 对象不能序列化吗? #30

jianglrelia opened this issue Mar 4, 2019 · 4 comments

Comments

@jianglrelia
Copy link

我想在连接开启的时候把session 和 用户token 做一个redis键值对保存。方便业务里面使用。但是session 没有提供序列化

@YeautyYE
Copy link
Owner

YeautyYE commented Mar 4, 2019

websocket和http不同。
http是无状态的,而用户的session实际上只是用户的数据。
websocket是有状态的,一个连接即是一个session。而连接不是数据,无法进行序列化来储存。

@jianglrelia
Copy link
Author

因为我是一个分布式应用,需要做服务端主动推给单一用户这样的一个功能。这样的话。没办法序列化,我是不是没办法去做这样一个功能了?
不知道有没有其他替代思路呢;
谢谢

@YeautyYE
Copy link
Owner

YeautyYE commented Mar 4, 2019

可以参考这个issues中,最下面的思路
#19

@jianglrelia
Copy link
Author

thanku

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