title: What does FormsAuthentication.SetAuthCookie do
body: <p>I'm using A createuserwizard control. On the CreatedUser Event I placed this code to add the user to a role.</p>
  
  <pre><code>    protected void RegisterUser_CreatedUser(object sender, EventArgs e)
      {
          FormsAuthentication.SetAuthCookie(RegisterUser.UserName, false /* createPersistentCookie */);
  
  
          if (!Roles.IsUserInRole("Test"))
          {
              var User= Membership.GetUser();
              Roles.AddUserToRole(User.UserName, "Test");
          }
  
          string continueUrl = RegisterUser.ContinueDestinationPageUrl;
  
          if (String.IsNullOrEmpty(continueUrl))
          {
              continueUrl = "~/";
          }
          Response.Redirect(continueUrl);
      }
  </code></pre>
  
  <p>I would also like to know what <code>FormsAuthentication.SetAuthCookie(RegisterUser.UserName, false /* createPersistentCookie */);</code> means and what it's used for and why <code>Membership.GetUser()</code> is null.</p>