title: Manually log in a user
body: <p>I'm working on a drupal site where I allow users to login while at the same time posting a content. I've successfully added email &amp; password fields to the original form, but I'm stuck as to how I should actually log in the user. (My plan is to do it in the validation step, before the content is created, to make the logged in user owner to the content).</p>
  
  <p>I can find three functions in user.module API that somehow looks right:</p>
  
  <ul>
  <li><a href="http://api.drupal.org/api/function/user_login_authenticate_validate/6" rel="nofollow noreferrer">http://api.drupal.org/api/function/user_login_authenticate_validate/6</a></li>
  <li><a href="http://api.drupal.org/api/function/user_authenticate/6" rel="nofollow noreferrer">http://api.drupal.org/api/function/user_authenticate/6</a></li>
  <li><a href="http://api.drupal.org/api/function/user_authenticate_finalize/6" rel="nofollow noreferrer">http://api.drupal.org/api/function/user_authenticate_finalize/6</a></li>
  </ul>
  
  <p>Now, my question is which one is it? Am I even on the right track?</p>