Attributes for configuring Forms authentication in Asp.Net

Hi

Many a time we use the forms authentication in our application. When using the forms authentication we need to configure it in the web.config file. There are many attributes to the configuration, which are many a time not utilized properly. Here is a look at the attributes of the Forms Authentication.

[Note: remember Forms element is the sub element of the authentication element inside System.web element in the web.config]

cookieless -  we can store the forms authentication ticket either in a cookie or in a cookieless representation of the URL. The default value is UseDeviceProfile. This means that ASP.Net determines storage of ticket on the basis of pre-computed browser profile.

DefaultUrl – this is the default URL of the Application.The request is redirected to this URL after successful login. Remember this value is only used when there is no value for redirect URL.

Domain – As the name suggest this specifies the Domain property on the HttpCookie containing the authentication ticket. We can use this attribute to share the same cookie till we have a common portion of a DNS namespace(two subdomain can share the cookie).

EnableCrossAppRedirects – if we set this attribute to true the forms authentication module then can extract the ticket from either the query string or the forms post variables.

LoginUrl – This is the URL of the login page. Unauthenticated users are redirected to this URL.

Name – this property contains the name of the Http cookie to be used for the authentication purpose.

Path – Path to use for the issued cookie. The default value is "/"

Protection - Method used to protect cookie data. Valid values are All, None, Encryption, Validation

RequireSSL – If set to true, Forms Authentication sets the secure bit on the forms authentication cookie.

SlidingExpiration - If set to true, Forms Authentication will periodically update the time to live for the forms authentication ticket. This occurs regardless of whether or not the ticket is contained in a cookie, or in a cookieless format on the URL.

Timeout - Amount of time in integer minutes, after which the cookie expires. The default value is 30. The timeout attribute is a sliding value, expiring n minutes from the time the last request was received.

Also check out this post of mine on the forms authentication.

Hope this helps
Thanks
Vikram


Share this post   Email it |  digg it! |  reddit! |  bookmark it!

Feedback

Posted on 11/6/2006 10:14:12 PM

ASP.Net Auth

Posted on 11/10/2006 8:18:36 AM

I'm facing a problem with session getting dropped unpredictably. The project uses .NET 2.0 and Atlas.
Are there any known bugs?

Posted on 11/11/2006 12:04:47 PM

Hi Mandeep

Are you deleting any directory some where in the code. In ASP.NET 2.0 if u delete any directory the application restart and hence u loose all the session values
Read this post of mine
http://vikram/BlogSiteLive/Post.aspx?postID=6

Vikram

Please post your comments:

Name:  
Email (optional): Your email address will not be posted.
URL (optional):
Comments: HTML will be ignored, URLs will be converted to hyperlinks  
Enter the text you see in the box:
 
Copyright © 2006 - 2009 Vikram Lakhotia