Asp.net Membership Logged in Users list
<p>I used following in my application to find the list of logged in user. It gives the list of logged in user but when i close the browser and clear the browser history, it shows the user isonline status true. Please can any one tell me where i am wrong?</p>

<p><strong>When User signIn am validating user and redirect to url,</strong></p>

<pre><code>if (user != null)
{
     if (Membership.ValidateUser(user.UserName, txtUserPassword.Text))
     {
        FormsAuthentication.SetAuthCookie(txtUserName.Text, false);
     }
}
</code></pre>

<p><strong>List of logged in user code</strong></p>

<pre><code> MembershipUserCollection allUsers = Membership.GetAllUsers();

 MembershipUserCollection filteredUsers = new MembershipUserCollection();

 bool isOnline = true;
 foreach (MembershipUser user in allUsers)
 {
    // if user is currently online, add to gridview list
   if (user.IsOnline == isOnline)
   {
      filteredUsers.Add(user);
   }
 }
</code></pre>
