Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Membership.UserIsOnlineTimeWindow Property

Specifies the number of minutes after the last-activity date/time stamp for a user during which the user is considered online.

Namespace: System.Web.Security
Assembly: System.Web (in system.web.dll)
public static int UserIsOnlineTimeWindow { get; }
/** @property */
public static int get_UserIsOnlineTimeWindow ()

public static function get UserIsOnlineTimeWindow () : int

Not applicable.

Property Value

The number of minutes after the last-activity date/time stamp for a user during which the user is considered online.

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.

The following code example shows the membership Element (ASP.NET Settings Schema) 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>

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.