so I have 2 pages: Chat page which runs on Node.js and Socket.io (WebSockets). And main page where user logins etc... I want to make it so when user logins on main page -> it validates details -> then stores user ID in session and goes into chat where he's identified by his userID.
Oh yeah and user accounts are stored on MySQL.
Okay. Cookies mechanism was created to communicate with different environments. Let's use it..
PHP:
Validate user data and save it into DB and then save id
to cookies.
NodeJS:
Read that id
from cookies and get data from DB (MySQL provider for nodejs)
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.