ARTICLE

Cookieless form authentication in VB.NET

Posted by Gurjeet Singh Articles | ASP.NET using VB.NET June 28, 2011
Using cookieless authentication user can be identified by unique token added to page’s URL
Download Files:
 
Reader Level:

Form authentication is used to identify user by a cookie name. When user is authenticated an encrypted cookie is added to the user's browser.  When user move from one page to another page user identity identified by cookies.

 Enable Forms Authentication in web.config file.

Web.Config

 
<?xml version="1.0"?>
 <
configuration>
     <
system.web>
       <
authentication mode="Forms"></authentication>
         <
compilation debug="false" strict="false" explicit="true" targetFramework="4.0"/>
     </
system.web>
 </
configuration>

Several configuration options are specific to Form authentication See below figure2.

forms1.gif

Figure 2

Cookieless Forms Authentication

First question definitely arise in your mind why we need to use Cookieless form authentication. The reason is every user use different browser.  Few browsers do not support cookies or a browser with cookies disabled.

When you use cookieless authentication user can be identified by unique token added to page's URL. When user relates from one page to another page token is passed automatically from one page to another page.

Cookieless attribute can use any of the following four values (also see figure 3):

  1. UseCookies : UseCookies value indicate that always use an form authentication cookie.UseUri :

  2. UseUri value indicate that always never use an authentication cookie.AutoDetect:

  3. AutoDetect automatically find whether a browser supports cookies or not.

  4. UseDeviceProfile: It is default value for cookieless attribute. It finds out that user browser support cookies or not. If browser does not support cookies then cookieless option will be used. Main use of UseDeviceProfile is to determine when to use cookieless authentication.

Web.Config

<?xml version="1.0"?>
 <
configuration>
   <
system.web>
     <
authentication mode="Forms">
       <
forms cookieless="AutoDetect">
       </
forms>
     </
authentication>
     <
compilation debug="false" strict="false" explicit="true" targetFramework="4.0" />
   </
system.web>
 </
configuration>

Login to add your contents and source code to this article
share this article :
post comment
 
Become a Sponsor
PREMIUM SPONSORS
  • ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications. Visit DynamicPDF here
    The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
Nevron Diagram
Become a Sponsor