title: How does correctly to use wp_signon?
body: <p>I make a custom form of authorization.
  var_dump shows that the data from $ _POST is correctly passed, but why does not the redirect to the specified page work then? Help me to understand</p>
  
  <p>my_authentification.php:</p>
  
  <pre><code>&lt;?php   $my_user = new WP_User(get_current_user_id());  ?&gt;
  &lt;form name="loginform" id="loginform" action="http://myreg_test_wordpress.loc/wp-content/themes/twentysixteen/my_auth.php" method="post"&gt;
  &lt;div class="form-title "&gt;&lt;h2&gt;Authorization Form:&lt;/h2&gt;&lt;/div&gt;
  &lt;label&gt;Email: &lt;br /&gt;
      &lt;input type="text" name="log" id="user_login" /&gt;&lt;/label&gt;
  &lt;label&gt;Password :&lt;br /&gt;
      &lt;input type="password" name="pwd" id="user_pass" /&gt;&lt;/label&gt;
  &lt;label&gt;&lt;input name="rememberme" type="checkbox" id="rememberme" value="forever" /&gt; remember&lt;/label&gt;
  &lt;input type="submit" name="wp-submit" id="wp-submit" value="Войти" /&gt;
  
  &lt;input type="hidden" name="redirect_to" value="&lt;?php bloginfo('url') ?&gt;/my-temp-page-edit/" /&gt;
  &lt;input type="hidden" name="testcookie" value="1" /&gt;
  &lt;a href="&lt;?php echo bloginfo('url').'/my-temp-page/' ?&gt;"&gt;&lt;div class="my_btn"&gt;link to registration page&lt;/div&gt;&lt;/a&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>my_auth.php:</p>
  
  <pre><code>$_SERVER['HTTP_REFERER'];
  require_once( dirname(__FILE__) . '/../../../wp-load.php' );
  
  if( is_user_logged_in() ) exit;
  
  
  $my_user = new WP_User(get_current_user_id());
  
  $user = wp_signon();
  if ( is_wp_error($user) ) {
  echo $user-&gt;get_error_message();
  //wp_redirect('http://myreg_test_wordpress.loc/wp-content/themes/twentysixteen/my_authorization.php');
  var_dump('my_authorization');
  
  } else {
  
  //wp_redirect('http://myreg_test_wordpress.loc/wp-content/themes/twentysixteen/my_temp_page_edit.php');
  var_dump('temp_page_edit');
  }
  </code></pre>