简体   繁体   中英

node.js socket.io & memcached - using PHP Session ID as Socket.IO Nickname

I understand if this is a silly questions.

I have a site that is delivered by PHP and every user has a userid stored in a memcached SESSION.

I'm also using node.js to deliver socket.io and using a nickname to know who the user is. (eg: it passes the userid over when the connection is initially made).

Is there anyway to get node.js to connect to the PHP SESSION to get the user ID from there when the connection is made - this would avoid people being able to fake being people. (more secure).

Or are there better ways to go about this? I would use SSL/HTTPS/WS but the site is HTTP and I believe mixing the 2 isn't allowed in some browsers now.

thankyou

也许检查此npm以获取节点中的php会话: https : //npmjs.org/package/nodePhpSessions

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM