Q:

web.config forms authentication, cookiename

I have a web.config with the following: 
 <system.web>
<customErrors mode="Off"/>

<authentication mode="Forms">
  <forms loginUrl="Login.aspx" name="SIPE_ASPXAUTH">
    <credentials passwordFormat="Clear">
      <user name="user1" password="123456"/>
      <user name="user2" password="123456"/>
      <user name="user3" password="123456"/>
    </credentials>

  </forms>

</authentication>

<authorization>

  <deny users="?"/>
</authorization>
<compilation debug="true"/>

This web.config always redirects me to the following url
http://localhost:53077/Login.aspx?ReturnUrl=%2fDefault.aspx

My start page is a Login.aspx and even after entering the correct credentails, it redirects me to the above url. 
So here's what I did.  
I took out the name property in the 
 <forms loginUrl="Login.aspx">

and left everything else untouched. 
It works perfectly. 
Can anyone pls explain why. 
I understand that this is a cookiename and the default is ASPXAUTH.  This cookie is used to authenticate a user.  Also it is stored in tools..options... 
What is the use of setting this cookiename.  Is it to allow cross browser functinality.n
How would I make this to work by having the name property in the  <forms loginUrl="Login.aspx">
Thank u

A:

config setting is seems to be OK but you have write some code in your login page's code behainsd also for form authentication.  After checking user name & password is corrent you have to write below code :
FormsAuthentication. SetAuthCookie(
                 this. TextBox_username. Text. Trim(), flase);

         FormsAuthenticationTicket ticket1 = 
            new FormsAuthenticationTicket(
                 1,                                   // version
                 this. TextBox_username. Text. Trim(),   // get username  from the form
                 DateTime. Now,                        // issue time is now
                 DateTime. Now. AddMinutes(10),         // expires in 10 minutes
                 false,      // cookie is not persistent
                 "HR"                              // role assignment is stored
                 // in userData
                 );
          HttpCookie cookie1 = new HttpCookie(
            FormsAuthentication. FormsCookieName, 
            FormsAuthentication. Encrypt(ticket1) );
          Response. Cookies. Add(cookie1);

For more detail on Form Authentication Click Here 

