title: From symfony2 form to a simple form users get incorrect password
body: <p>Originally creating a normal registration form (email + password) using the symfony form builder i found no problems at all registering my users.</p>
  
  <p>For some technical issues and strategic stuff im not using any more the symfony form builder and i just made a common html form. The username, salt and password gets saved in database but when i tried to login it does not work, so the password or salt are wrong, and that makes me think that maybe the salt is created using a token send as a hidden field created by the symfony form builder, am i right?</p>
  
  <p>So, originally since the symfony form builder allows you to parse the data directly into an entity i did something like this:</p>
  
  <pre><code>    if( 'POST' === $this-&gt;getRequest( )-&gt;getMethod() ) {
          $form-&gt;bindRequest( $this-&gt;getRequest( ) );
  
          if( $form-&gt;isValid( ) ) {
              $userSignup = $form-&gt;getData( );
  
               $user = $userSignup-&gt;getUser( );
  
               $user-&gt;setPassword( $this-&gt;_encodePassword( $user ) );
  </code></pre>
  
  <p>Now, since im using a normal form:</p>
  
  <pre><code>        if(isset($_GET['user_signup']['user']['username']) &amp;&amp; $this-&gt;_validemail($_GET['user_signup']['user']['username'])) $username = $_GET['user_signup']['user']['username']; else die('BAD EMAIL');
          if(isset($_GET['user_signup']['user']['password']) &amp;&amp; strlen($_GET['user_signup']['user']['password']) &gt;= 5 &amp;&amp; strlen($_GET['user_signup']['user']['password']) &lt;= 20)  $password = $_GET['user_signup']['user']['password']; else die('BAD PASSWORD');
  
          $user = new user();
          $user-&gt;setUsername($username);
          $user-&gt;setPassword( $this-&gt;_encodePassword( $user ) );
  </code></pre>
  
  <p>The encodePassword function:</p>
  
  <pre><code>protected function _encodePassword(  User $user )
  {
      $factory    = $this-&gt;get( 'security.encoder_factory' );
      $encoder    = $factory-&gt;getEncoder( $user );
      return      $encoder-&gt;encodePassword( $user-&gt;getPassword( ), $user-&gt;getSalt( ) );
  }
  </code></pre>
  
  <p>Im re utilizing someone else code so maybe im having trouble understanding how encodePassword works.</p>