2017-07-06 2 views
0

Wie kann ein Login Timeout hinausgeschoben werden? In einer VS 2015 Light Switch Web App mit Forms Authentication möchte ich das Timeout auf 1h hinausschieben. Ist das möglich und wie? Bitte um Input, merci marcelForms Authentication Login timeout postpone

+0

Did my proposed answer help to provide a solution? –

Antwort

0

As my German leaves a lot to be desired, I'll revert to English to answer your question:

In a Visual Studio 2015 LightSwitch Web app, using Forms Authentication, how would you alter the timeout to 1 hour?

Assuming that you're referring to the timeout for the HTTP cookie, used by the Forms authentication login, this can be changed from the default 30 minutes to 1 hour by editing your applications web.config file.

The web.config section to modify is the <forms> element and this needs to be changed to include the optional timeout attribute as follows:

<system.web> 
    <authentication mode="Forms"> 
    <forms name="YourFormsCookieName" timeout="60" /> 
    </authentication> 

This optional timeout attribute specifies the number of minutes after which the authentication cookie expires (if it's not specified it defaults to 30 minutes).

The following quotes the MSDN information on this optional attribute:

Specifies the time, in integer minutes, after which the cookie expires. If the SlidingExpiration attribute is true, the timeout attribute is a sliding value, expiring at the specified number of minutes after the time that the last request was received. To prevent compromised performance, and to avoid multiple browser warnings for users who have cookie warnings turned on, the cookie is updated when more than half of the specified time has elapsed. This might cause a loss of precision. The default is "30" (30 minutes).

Note

Under ASP.NET V1.1 persistent cookies do not time out, regardless of the setting of the timeout attribute. However, as of ASP.NET V2.0, persistent cookies do time out according to the timeout attribute.