java - app服务器怎么实现判断用户登录超时还是被踢出?
大家讲道理
大家讲道理 2017-04-17 16:43:15
0
1
803
大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(1)
伊谢尔伦

The question is not very clear. It is recommended that the questioner explain his or her question clearly and concisely.
Assuming that being kicked offline is a management-side function (such as clicking on a user menu and selecting to kick out), the login timeout is what we usually understand as server-side timeout.
If the broadcast message is implemented to say, "So-and-so logged out (login timeout)/So-and-so was kicked out", I will do this:

1. At least one session manager is required, whether it is a server-side extension or a custom one. Manage login sessions, basic CRUD.
2. A user ID, marking the reason why this person logged out after the last login. 1. It timed out; 2. It was kicked; 3. It logged out by itself.

Events about user entry and exit are emitted or relayed through the session manager. For example, if I kick someone, I have to tell the session manager to take this person's execution offline. The parameters may include UID and the reason for the shutdown.
When a session manager event (someone logs in, logs out after timeout, logs out, or is kicked out) occurs, just broadcast the message.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template