Click here to Skip to main content
16,017,351 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I am working on one web application in which i want to make sure that website allow only one login per user at a time . How to check that current user already logged in or not .
Posted
Updated 29-Oct-13 19:21pm
v2
Comments
Harshil_Raval 30-Oct-13 1:22am    
Just do one thing. In your database, in your usertable, add one bit field called IsLoggedin. when user login check for true or false value. If value is true(i.e. already logged in), then automatically redirect to home page. and if value is false(not logged in), then update that value to true, and redirect.

1 solution

just add status column in your login table and maintain a status as '1' while login and maintain as '0' while logoff for every user.
 
Share this answer
 
Comments
Member 13325553 18-May-18 8:58am    
If the system is crash or internet connectivity lose then how to update '0' in the database?
Member 14643781 7-Aug-20 5:27am    
if user doesn't logout ,,directly close browser then??

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900