Click here to Skip to main content
14,919,896 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to implement LogIn and LogOut functionality with login name taken from database
Posted

1 solution

So whats the problem?
Design a login page that takes the username/password. pass on those two to the database for verification if they are correct. Get a true for correct and false for incorrect.
If true: then navigate from login page to home page. Store the user details in a session and use that on PageLoad of other pages as authentication flag. Now when you logout, just clear this session. Thus, whenever other pages are tried to be navigated, they will direct towards login page as session is empty.

If false: then show wrong username/password!

P.S.: Form's authentication is not involved anywhere here!
   

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