我正在尝试与ASP.NET和ajax/jquery进行一次随机聊天。当用户进入聊天室时,我需要一种方法来识别用户,并给他一个唯一的id,我将记录他的话在我的数据库中。我需要使用会话、cookie或其他什么吗?实现随机聊天的最好方法是什么?
发布于 2012-01-06 17:28:14
会话:
- Will expire if the user are idle for some time in the chat
- Will be terminated when the browser closes, by the server.
+ Cannot be changed by the userCookie
+ Will not expire
+ Will not be terminated on browser close, so the system can identify the user to be the same the next time
- Can be changed by the user识别用户的最佳方式是数据库(MySQL / Oracle / MSSQL)和cookie的组合。
发布于 2012-01-06 17:28:03
我认为你应该使用session_id
https://stackoverflow.com/questions/8755586
复制相似问题