title: How to add Remember me function at custom login box?
body: <p>In my theme, there's custom page for the login. Login function at functions.php is like this </p>
  
  <pre><code>   function log_in($username, $password) {
  
      $user = parse_user($username);
  
      $username = $username;
      $password = $password;
  
      if(isEmptyString($username)) return new WP_Error('username', 'required');
      if(isEmptyString($password)) return new WP_Error('password', "required");
      if(!wp_check_password( $password, $user-&gt;user_pass ) ) return new WP_Error('wrong_password', "wrong");
  
      wp_set_auth_cookie($user-&gt;ID, $remember);
      wp_login($username, $password);
  
      redirect_profile();
  
  }
  
  function parse_user($info = null, $return = 'object') {
      if ( is_null( $info ) ) {
          global $current_user;
          if ( empty( $current_user-&gt;ID ) ) return null;
          $info = get_userdata( $current_user-&gt;ID );
      }
      elseif ( empty( $info ) ) {
          return null;
      }
      if( $return == 'ID' ) {
          if ( is_object( $info ) ) return $info-&gt;ID;
          if ( is_numeric( $info ) ) return $info;
      }
      elseif( $return == 'object' ) {
          if ( is_object( $info ) &amp;&amp; $info-&gt;ID) return $info;
          if ( is_object( $info )) return get_userdata( $info-&gt;ID );
          if ( is_numeric( $info ) ) return get_userdata( $info );
          if ( is_string( $info ) ) return get_userdatabylogin( $info );
      }
      else {
          return null;
      }
  }
  </code></pre>
  
  <p>I want to add remember me checkbox for user to logged in all the time until they logout. How can i add this ? Please kindly help me out. Thank you. </p>