Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 07, 2011 04:22 PM by ryanw51
Jan 09, 2009 01:34 AM|LINK
I'm trying to write some code to warn the user when they are close to been logged out (Forms Authentication). Basically we have a form that could take longer than 20 mins to fill out especially if they walk away from the machine and come back. We don't want
them losing their data so i want to warn them. I think this warning would be useful across the whole app not just the form.
I'm using AjaxPro to make an ajax call to retrieve the number of minutes the user has before they are logged out which is working well but due to .net's sliding expiration the authentication ticket is been renewed when the ajax call is made when there is
10 or less minutes until expiry. I've tried clearing the response but the authentication ticket is still been updated.
Does anybody have any ideas on how to stop the authentication ticket from renewing when i make this ajax call? or maybe suggest another method. Code is below
public string GetTicketExpiryInMinutes()
//HttpContext.Current.Response.SuppressContent = true;
return ((FormsIdentity) HttpContext.Current.User.Identity).Ticket.Expiration.Subtract(DateTime.Now).Minutes.ToString();
Apr 07, 2011 04:22 PM|LINK
Did you ever figure anything out? I'm having this exact problem myself.