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

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top