System.Web.Security.MembershipUser.LastActivityDate Property

Gets or sets the date and time when the membership user was last authenticated or accessed the application.

Syntax

public virtual DateTime LastActivityDate { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

The MembershipUser.LastActivityDate for a user is updated to the current date and time by the erload:System.Web.Security.Membership.CreateUser and Membership.ValidateUser(string, string) methods, and can be updated by some overloads of the erload:System.Web.Security.Membership.GetUser method. You can use the Membership.UpdateUser(MembershipUser) method to set the MembershipUser.LastActivityDate property to a specific date and time.

The MembershipUser.LastActivityDate is used to determine whether a user is online. A user is considered online if the current date and time minus the Membership.UserIsOnlineTimeWindow property value is earlier than the MembershipUser.LastActivityDate for the user.

The System.Web.Security.SqlMembershipProvider sets the MembershipUser.CreationDate, MembershipUser.LastLoginDate, MembershipUser.LastActivityDate, and MembershipUser.LastPasswordChangedDate date to the same date and time when a membership user is created by the erload:System.Web.Security.Membership.CreateUser method.

Note:

The MembershipUser.LastActivityDate for a user is updated by the classes in the System.Web.Profile and the System.Web.UI.WebControls.WebParts namespaces whenever user data is retrieved from or set at the data source. If your application uses the same data source to store user information, and your System.Web.Profile.ProfileProvider and System.Web.UI.WebControls.WebParts.PersonalizationProvider are configured with the same applicationName as your System.Web.Security.MembershipProvider, then the MembershipUser.LastActivityDate and MembershipUser.IsOnline properties of the user will reflect this behavior.

Requirements

Namespace: System.Web.Security
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0