Membership.UserIsOnlineTimeWindow Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Specifies the number of minutes after the last-activity date/time stamp for a user during which the user is considered online.
public:
static property int UserIsOnlineTimeWindow { int get(); };
public static int UserIsOnlineTimeWindow { get; }
static member UserIsOnlineTimeWindow : int
Public Shared ReadOnly Property UserIsOnlineTimeWindow As Integer
The number of minutes after the last-activity date/time stamp for a user during which the user is considered online.
The following code example shows the membership element in the system.web
section of the Web.config file for an ASP.NET application. It specifies that the application use an instance of the SqlMembershipProvider and sets the userIsOnlineTimeWindow
attribute to 20 minutes.
<membership defaultProvider="SqlProvider"
userIsOnlineTimeWindow="20">
<providers>
<add name="SqlProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="SqlServices"
enablePasswordRetrieval="true"
enablePasswordReset="false"
requiresQuestionAndAnswer="true"
passwordFormat="Encrypted"
applicationName="MyApplication" />
</providers>
</membership>
The UserIsOnlineTimeWindow property value is checked during the call to GetNumberOfUsersOnline. If the LastActivityDate for a user is greater than the current date and time minus the UserIsOnlineTimeWindow value in minutes, then the user is considered online. You can determine whether a membership user is considered online with the IsOnline property of the MembershipUser class.
The LastActivityDate for a user is updated when a user's credentials are successfully validated by the ValidateUser method. You can also update the LastActivityDate for a membership user when you call one of the GetUser overloads. If you call a GetUser overload that takes a userIsOnline
parameter, specify a value of true
to update the LastActivityDate for the user.
Product | Versions |
---|---|
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: