How to create ASP.NET Membership cookie properly?
<p>I'm using the Membership API for my login system and a wierd thing has been bothering me. I allow user to choose whether to "Remember Me", which means whether to create a persistent cookie with one month expiration period.</p>

<p>In the Web.config, I wrote:</p>

<pre><code>&lt;authentication mode="Forms"&gt;
  &lt;forms timeout="60"  /&gt;
&lt;/authentication&gt;
</code></pre>

<p>This is supposed to be a default session cookie of 60 minutes.</p>

<p>In the code behind of the login page:</p>

<pre><code>if(Membership.ValidateUser(UsernameTextBox.Text, PasswordTextBox.Text))
        {
            authCookie = FormsAuthentication.GetAuthCookie(UsernameTextBox.Text, RememberMeCheckBox.Checked);
            if(RememberMeCheckBox.Checked)
                authCookie.Expires = DateTime.Now.AddMonths(1);
            Response.Cookies.Add(authCookie);
            Response.Redirect(FormsAuthentication.GetRedirectUrl(UsernameTextBox.Text, RememberMeCheckBox.Checked));
        }
</code></pre>

<p>The result however is strange. I seem to have created a persistent cookie of 60 minutes! How is this possible?</p>
