Configuring Forms Authentication in ASP.Net

Several configuration options are specific to Forms authentication:
  • cookieless : Enables you to use Forms authentication even when a browser does not support cookies. Possible values are UseCookies, UseUri, AutoDetect, and UseDeviceProfile. The default value is UseDeviceProfile.
  • defaultUrl : Enables you to specify the page to which a user is redirected after being authenticated. The default value is Default.aspx.
  • domain : Enables you to specify the domain associated with the authentication cookie. The default value is an empty string.
  • enableCrossAppRedirects : Enables you to authenticate users across applications by passing an authentication ticket in a query string. The default value is false.
  • loginUrl : Enables you to specify the path to the Login page. The default value is Login.aspx.
  • name : Enables you to specify the name of the authentication cookie. The default value is .ASPXAUTH.
  • path : Enables you to specify the path associated with the authentication cookie. The default value is /.
  • protection : Enables you to specify how the authentication cookie is encrypted.Possible values are All, Encryption, None, and Validation. The default value is All.
  • requiresSSL : Enables you to require a SSL (Secure Sockets Layer) connection when transmitting the authentication cookie. The default value is false.
  • slidingExpiration : Enables you to prevent the authentication cookie from expiring as long as a user continues to make requests within an interval of time.Possible values are True and False. The default value is True.
  • timeout : Enables you to specify the amount of time in minutes before the authentication cookie expires. The default value is 30.
Several of these configuration settings are related to the authentication cookie. e.g, you can use the web configuration file to change the name of the authentication cookie.

Web.Config

<configuration>
<system.web>
<authentication mode=”Forms”>
<forms name=”MySite” />
</authentication>
</system.web>
</configuration>
Tags: ,
Hot on Web:


About author