GeekArticles
Database
SQL ServerExamining ASP.NET's Membership, Roles, and Profile - Part 10
Author: aspnet.4guysfromrolla.com |
Published: 17th Apr 2008 |
Visited: 71 times |
Add CommentFiled in: SQL Server
The Membership system automatically tracks the last
date and time each user's account has been accessed. With the SqlMembershipProvider, this information is
stored in the aspnet_Users database table in a datetime column named LastActivityDate. This
column is automatically updated to the current UTC date and time whenever a user
logs into the site, whenever their user account information is updated, and whenever their user account information is retrieved.
In addition to tracking each user's last activity date and time, the Membership system includes a method named
GetNumberOfUsersOnline.
This method returns the number of users whose last activity date and time is within a specified window; by default, this method returns the number of
users whose aspnet_Users.LastActivityDate value falls within the last 15 minutes.
This article, the tenth installment of a multipart article series on ASP.NET's Membership, Roles, and Profile systems, examines
the GetNumberOfUsersOnline method and see how to extend the Membership system to include additional user
activity information. Specifically, we will add a new table to the database used by the SqlMembershipProvider that associates a description
of each user's current action. We will then update our ASP.NET pages to update the records in this table to include a description of the user's
current action. For example, when visiting the home page we may use the description, "Viewing the home page." Finally, we will create a web page that displays
the list of currently logged on users and their last known action. Read on to learn more!
Read More >
Read Article Sponsored Links
Related Articles
• Consumer and Provider Roles Consumer and Provider Roles
When we speak of the Consumer and Provider roles for the ServiceMix components, the difference is very subtle at first sight, but very important from a programmer perspective. The following figure shows the Consumer and Provider roles in the ServiceMix E ...