views:

188

answers:

1

What's the best/most efficient way whether the user of my .NET web application is currently logged in.

I'm currently using Membership.GetUser() != null, but now that I realize that this involves a DB-roundtrip, I wonder if there's a better way. Maybe HttpContext.Current.User.Identity.IsAuthenticated?

+6  A: 

You have answered your own question. The IsAuthenticated property is the best way to do this.

Joel Cunningham