By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,919 Members | 1,587 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,919 IT Pros & Developers. It's quick & easy.

Best Practice for Checking if user is logged into application

P: n/a
Does anyone have suggestions on the best way to check if a user is logged
into asp.net web application?

We are not using forms authentication. We are authenticating our users
against active directory. I some people use the database to determine if a
user is logged in between web pages and check in the web forms.
Nov 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
When you say 'against active directory' .... is that Windows Authentication?

You can use the User.Identity class to obtain certain information about the
currently logged in user:

User.Identity.IsAuthenticated = [True|False]
User.Identity.Name = [<username>]
User.Identity.AuthenticationType = [Forms|Windows...]

You can setup forms authentication to authenticate against Active Directory,
which is my preferred method, because you can have a much more integrated and
themed login page (as opposed to Windows/Integrated authentication) and still
get AD-based credential authentication. Check out this link:

http://msdn.microsoft.com/library/de...SecNetHT02.asp

I've got a working version in VB.NET to post if you're not working in C#.

Andrew A. Willett
Tech Xero
"Mike Moore" wrote:
Does anyone have suggestions on the best way to check if a user is logged
into asp.net web application?

We are not using forms authentication. We are authenticating our users
against active directory. I some people use the database to determine if a
user is logged in between web pages and check in the web forms.

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.