Community | problem | Online In fact, NetEase also took the foreign code to change the next to do their own intake. The code seems to be on a foreign website, you can find out how it will be.
In addition, NetEase judge a user online or not, I think this way can be achieved.
1, log in, the user information recorded in a table. Where the critical data is the current logon time. At the same time to
to a
A number that the user uniquely identifies.
2, NetEase's pages are constantly automatically refreshed. Please note that the page:
<meta http-equiv= "Refresh"
Content= "20;url=http://club.netease.com:8888/xxxx" >
Where the URL should be an address that is specifically used to authenticate the re-registration. XXXX is and personal information
Related
A string that is the unique identification number of the user mentioned above. Each refresh, in fact, is to modify the table in the
The mind of the household
The current time in the record is the present time.
3, each operation needs to authenticate the user identity. The process of authenticating a user should be:
A, judge whether the person is A user;
B, remove the list of online people from the current online table and see if the person is in the list. If not, it must be a super
When If in, that operation continues. How to tell a timeout is actually a question of how to determine the list of online people
Problem. Assume
10 minutes timeout, then the online table is in fact all eligible: current time-Last registration time <10 minutes
For all
Recording. This last registration time is the time to fill in when the page is refreshed.
4, the regular emptying of the record of the personnel, to maintain the size of the table and improve the efficiency of the search.