Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   ASP.NET (http://www.programmingforums.org/forum35.html)
-   -   how to check if a user is logged in (http://www.programmingforums.org/showthread.php?t=11807)

lucifer Nov 5th, 2006 1:05 PM

how to check if a user is logged in
 
hi
i want to check if the person acessing a page is logged in or not
plz help

Dameon Nov 5th, 2006 1:28 PM

...to what?

Iftikhar Nov 5th, 2006 5:55 PM

you have not asked a complete questions. There can be various ways. The one easy method is to create a session variable on the time of logon for that user on successful logon. Then where u need to check the logon information check session, and it will tell you the story. On logoff destroy session.

lucifer Nov 6th, 2006 4:43 AM

sorry
well what i want is that when a person logins that there should be some way to keep him logged in and if any page is accessed without login them i should be able to show acess denied message

Iftikhar Nov 6th, 2006 8:28 AM

The method I suggested will work. Create session variable at the login time and check at page_load this session. If it is null there was no proper login else it was proper

Samuaijack Nov 8th, 2006 8:54 PM

may be (it will only work if the user is enabling cookies) you can make a cookie on his comp. with the username and password ofcourse encrypted and when the site loads it will check for that cookie if it is there it will take the username and password and log him in.


All times are GMT -5. The time now is 1:36 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC