Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Default expiration time for Session?
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01340515
Message ID:
01340517
Vues:
8
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform