I have an ASP.NET AJAX application that uses forms authentication. There are no postbacks in this application; all server functionality is on Page_Load or in web service calls made directly from the Javascript (via the AJAX toolscripts). On each page load or web service call, the forms authentication ticket is updated by calling a simple utility method:
public static FormsAuthenticationTicket RenewFormsAuthTicket()
{
FormsAuthenticationTicket oldTicket = ((System.Web.Security.FormsIdentity)HttpContext.Current.User.Identity).Ticket;
FormsAuthenticationTicket newTicket = new FormsAuthenticationTicket(oldTicket.Version + 1, oldTicket.Name, DateTime.Now, DateTime.Now.AddMinutes(((System.Web.Configuration.AuthenticationSection)System.Configuration.ConfigurationManager.GetSection("system.web/authentication")).Forms.Timeout.Minutes), oldTicket.IsP ...
Go to the complete details ...