我可以从Socket.io访问cookie吗? [英] Can I access a cookie from Socket.io?

查看:86
本文介绍了我可以从Socket.io访问cookie吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在cookie中设置一些用户信息并能够在连接时访问它,这有可能吗?

I want to set some user information in a cookie and be able to access it on connection, is this possible?

推荐答案

client.request.headers.cookie导致竞争,因为cookie始终指向最后登录的用户.

client.request.headers.cookie leads to race conditions as the cookie always points to the last logged in user.

请参阅: Socket.IO身份验证.

这篇关于我可以从Socket.io访问cookie吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆