title: Setting Sessions inside PHP Class
body: <p>I'm creating a user class to handle my logins. As I wish to set the sessions inside the class after the username and password are validated, do I have to use session_start() at the top of the class, inside the public function where the sessions are to be set, or where the instance is created? Perhaps it could go inside function _construct()?</p>
  
  <p>This is how I would like to call the class:</p>
  
  <pre><code>&lt;php
  
  include('user_class.php');
  $user = new user;
  $user-&gt;login($username,$password);
  
  
  ?&gt;
  </code></pre>