Home > Software engineering >  How to judge whether a user is logged in?
How to judge whether a user is logged in?

Time:09-28

Such as topic, how to judge whether a user is logged in, whether can add a field to illustrate the user is logged in?

CodePudding user response:

Can be setting up a special table,

CodePudding user response:

See if the database record

CodePudding user response:

A single login status table (UserID, expiry time)
The foreground application needs to regularly update the expiry time, from the current time + n minutes, so if the bolt, the front desk program crashes and other reasons not to delete login record, still can use the time to determine whether the failure,
Pay attention to the timing between m must be smaller than n at the front desk, and there can be time consuming more than n minutes operation,

CodePudding user response:

Login to judge the existence of global temporary table and does not exist is to create a global temporary tables, to take a user name name list, there will prompt the user has logged in,
  • Related