Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Default expiration time for Session?
Message
 
 
To
20/08/2008 15:46:07
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01340515
Message ID:
01340519
Views:
7
No, I don't think you're on the right track here. In the meantime I found this article by googling "Session expiration" and from the first link (question)

http://msdn.microsoft.com/en-us/library/aa720391.aspx

Looking into it now.

>>Hi everybody,
>>
>>In our master page I see the following code
>>
>>
>>private void LoadExpiresScript()
>>    {
>>        FormsAuthenticationTicket Athen = (FormsAuthenticationTicket)((FormsIdentity)this.Page.User.Identity).Ticket;
>>
>>        if (!Athen.IsPersistent)
>>        {
>>            //Athen.Expiration = DateTime.Now.AddHours(12);
>>            TimeSpan TimeLeft = Athen.Expiration - DateTime.Now;
>>            double TimeOutMil = TimeLeft.TotalMilliseconds - 10000;
>>
>>
>>            this.Page.ClientScript.RegisterStartupScript(this.GetType(), "AuthenticationTimeOut",
>>                @"var defaultTimeOutMilliseconds = " + Convert.ToInt32(TimeOutMil).ToString() + @";
>>
>>var TimeOutId;
>>
>>    setupTimeout(defaultTimeOutMilliseconds);
>>
>>function displayAlert(){alert(""As a security precaution, your Friendship Circle Administration session is about to end. Due to inactivity."");
>>top.location=""" + FormsAuthentication.LoginUrl + "?ReturnUrl=" + Server.UrlEncode(Request.Url.PathAndQuery) +
>>            @""";
>>setupTimeout(defaultTimeOutMilliseconds);
>>}
>>function setupTimeout(timeOutMilliseconds)
>>{
>>    TimeOutId = window.setTimeout('displayAlert()', timeOutMilliseconds);
>>}
>>function ResetTimeOut()
>>{
>>    window.clearTimeout(TimeOutId);
>>    setupTimeout(defaultTimeOutMilliseconds);
>>}", true);
>>        }
>>    }
>>
>>When I was testing it I noticed that the Expiration time was set for ~30 minutes after I started my session. I'm guessing it's some default setting. How and where can I adjust it and what are the consequences of making this time bigger?
>>
>>Thanks in advance.
>
>Search for the value of defaultTimeOutMilliseconds, i think :-)
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform