I have set UserIsOnlineTimeWindow ="2" in web.config then my logout() function has been modified as
public ActionResult LogOff()
{
MembershipUser usr = Membership.GetUser();
usr.LastActivityDate = DateTime.Now.AddMinutes(-2);
FormsAuthentication.SignOut();
return RedirectToAction("Index", "Home");
}
Still after returning to Home after Logout still the User.IsOnline = true
Only after idle time of 2 minutes User.IsOnline = false
How to make the user Offline at FormsAuthentication.SignOut(); Please help.