Hi,
The below method is working when user click the logout button an di am using form authendication with 20 minutes;
But i have got a problem, after the timeout when the page redirect to login page, i need to call the method, but i could not
get the page user identity name because the values are expires;
How to set user online set to offline.
void logout()
{
MembershipUser user; user = Membership.GetUser(Page.User.Identity.Name);
user.LastActivityDate = DateTime.Now.AddMinutes(-20);
Membership.UpdateUser(user);
FormsAuthentication.SignOut();
}
in web.config
<authentication mode="Forms">
<forms loginUrl="~/Account/Log ...
Go to the complete details ...