Click here to Skip to main content
15,888,733 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I have an web application in asp.net in that i have checked userid and password of a user from database and redirecting to a specified page. Now if same user passes it's credential to login page then it should show that you are already login.

Please let me know how to handle it .Is there a way to accomplish it as we know that in most of websites (like gmail etc) the user can login with same credential at a time in different browser or same browser.So I want that if a user is login then if he tries again login then it should show that you are already login.

Thanking You

Mohd Wasif
Posted

If you are using Forms Authentication,
VB
System.Web.HttpContext.Current.User.Identity.IsAuthenticated
can give you this information.
 
Share this answer
 
You can implement this in two ways.
Server side caching variable or as an application variable using hashtable or any object which just maintains the current loggin users.
Or you can set the active state of the user in database as 1 once logged and refer to that before logging again.
 
Share this answer
 
Comments
Mohd Wasif 19-May-11 5:48am    
You are right but the thing is this if user forgot to logout or he closes the browser then still it will be showing that you are already login. This is my problem.

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