title: when and where do we use session_id()
body: <p>I can't understand the code below and I don't know when we use <code>session_id()</code> before <code>session_start()</code> . </p>
  
  <pre><code>&lt;?php
  if($_GET){
      //defining the session_id() before session_start() is the secret
      session_id($_GET['session_id']);
      session_start();
      echo "Data: " . $_SESSION['theVar'];
      //use your data before below commands
      session_destroy();
      session_commit();
  }else{
      //common session statement goes here
      session_start();
      $session_id=session_id();
      $_SESSION['theVar'] = "theData";
      echo "your.php?session_id=" . $session_id;
  }
  ?&gt;
  </code></pre>
  
  <p>i want you to  explain it ! not just copying the description of php.net !<br>
   on the other hand , where is  session_id() used ?! what's its usage ?! 
  thank you in advance ! </p>