Authenticate user for socket.io/nodejs

前端 未结 4 1386
情歌与酒
情歌与酒 2020-12-02 04:34

I have a php login, the user puts in a username/password, it checks the mysql db against the login information. If authenticated a session is created via php and the user ca

4条回答
  •  天涯浪人
    2020-12-02 05:09

    Remember that sessions are just files stored in the php sessions directory. It won't be a problem for node.js to get the session id from the cookie and then check if the session really exists in the sessions directory. To get the path of the sessions directory refer to the session.save_path directive in your php.ini.

提交回复
热议问题