O'Reilly logo

ASP.NET MVC 2 Cookbook by Richard Kimber, Andrew Siemer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Keeping track of anonymous visitors versus logged-in users

In this recipe, we are going to take a look at a common task for most sites. We want to be able to keep track of how many users are present on our site at any given time. We will also attempt to distinguish between known (logged-in users) and unknown (anonymous) users. To keep track of users as they come to our site, we will need to attach some of the events, such as Session_Start and Session_End, which our application exposes. To distinguish between the known and unknown users, we will have to tap into our membership functionalities, such as registration, logging on, and logging off.

How to do it...

  1. Start by creating a new default ASP.NET MVC 2 application.
  2. Next, we will need to create ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required