title: PHP session on android application
body: <p>I am creating a php Rest API for my android application. I want to get all information of the logged user(logged in using his email and password). For this purpose I use <code>$_SESSION['email']</code>, but when I tried this using my app, didn't work. Can you please explain me how to use php session in android app. Thank you very much</p>
  
  <pre><code>function getLoggedUserInfo() {
  
      $sql = "SELECT  `id`,`name`, `gender` FROM users WHERE email=:email";
  
      try {
  
      $paramemail = $_SESSION['email'];
  
      $dbCon = getConnection();
          $stmt = $dbCon-&gt;prepare($sql);  
          $stmt-&gt;bindParam("email", $paramemail);
          $stmt-&gt;execute();
          $user = $stmt-&gt;fetchObject();  
          $dbCon = null;
          echo json_encode($user); 
  
  
      } catch(PDOException $e) {
          echo '{"error":{"text":'. $e-&gt;getMessage() .'}}'; 
      }
  }
  </code></pre>