Most Efficient Way to Tell if User is Logged On

J

Jonathan Wood

My code needs to test if the user is currently logged on.

I know I can check if Membership.GetUser() returns null, but that returns
data from the database that I don't need. I'm thinking there should be some
sort of flag that doesn't require a database hit (or at least not one in
addition to whatever ASP.NET is doing).

Any tips?

Thanks.

Jonathan
 
G

Guest

My code needs to test if the user is currently logged on.

I know I can check if Membership.GetUser() returns null, but that returns
data from the database that I don't need. I'm thinking there should be some
sort of flag that doesn't require a database hit (or at least not one in
addition to whatever ASP.NET is doing).

Any tips?

Thanks.

Jonathan

HttpContext.User.Identity.IsAuthenticated
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top