syedIb
syedIb

Reputation: 19

How to create single user login page?

i want to create a user account using asp page in which only one user can login their account ,if that page is currently logged then no one can log in that page after log out only another user can log in that account

Upvotes: 0

Views: 128

Answers (2)

Melina
Melina

Reputation: 68

Darshan Joshi's answer is one way to do it, and if you have a simple enough application it may be sufficient.

Depending on the specifics of your application, you might want to think about different angles.

For example: If more than one distinct page needs to only take one user at a time, I would think about creating a new table with a record for each of these pages. This way, you can set a page as logged-in/in-use using the user's unique ID when someone logs in or access the page. When the user logs out/leaves the page (or if their ASP Session expires- users do not always log out cleanly!) you can "unlock" the page again. Not only that, you might reduce database load by searching specifically for the page record rather than any user with a logged-in flag.

Upvotes: 0

user841123
user841123

Reputation:

This may give you glimps, in database you may add a table UserLogin with two fields UserId, IsLogin. While loggin in any user check for islogin status if it returns true then dont allow user to login. If returns false then allow user to get login. After successful login switch islogin state true.

Hope I have understand your question.

Upvotes: 0

Related Questions