Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Default expiration time for Session?
Message
From
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:
01340517
Views:
7
This message has been marked as a message which has helped to the initial question of the thread.
>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 :-)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform