Most Efficient Way to Tell if User is Logged On

  • Thread starter Thread starter Jonathan Wood
  • Start date Start date
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
 
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
 
Back
Top