title: How to create custom WebSecurity.Login and WebSecurity.CreateUserAndAccount methods in MVC 4?
body: <p>When we choose <code>New Project --&gt; MVC 4 --&gt; Internet Application</code>, it will automatically generate AccountController for us. In this controller, I only care about 2 actions, <code>Login</code> and <code>Register</code>.</p>
  
  <p>In MVC 3, it uses Membership's static methods, <code>ValidateUser</code>in <code>Login</code> action and <code>CreateUser</code> in <code>Register</code>. So, if I want to integrate it with my own database, I just need create <code>CustomMembershipProvider</code> by extending <code>MembershipProvider</code> and override that two methods.</p>
  
  <p>But in MVC 4, it uses <code>WebSecurity.Login</code> and <code>WebSecurity.CreateUserAndAccount</code>. My questions are:</p>
  
  <ol>
  <li>How can I make it use my own database like I did in MVC 3?</li>
  <li>What's the different? Why doesn't it keep using static Membership methods? Why does it have to change to <code>WebSecurity</code>?</li>
  </ol>
  
  <p>Thanks so much for your help.</p>