title: Use of session_id() and session_name
body: <p>I am new to PHP. What I do for managing sessions in my code is, simply start session using <code>session_start()</code>. Reading around on web, I came across, <code>session_id</code> and <code>session_name</code>.</p>
  
  <p>What is the use of <code>session_id</code> and <code>session_name</code>. Application based, where can we use <code>session_name</code> and <code>session_id</code> in Php.</p>
  
  <p>How I write my code is:</p>
  
  <pre><code>&lt;?php
     session_start();
     if(isset($_SESSION['name']))
     {
         //Render the page.
     }
     else
     {
         session_destroy();
         //redirect to some simple page.
     }
  ?&gt;
  </code></pre>
  
  <p>As per my code, where can I use <code>session_id</code> or <code>session_name</code>. Is this a good style to write the code, or should I choose to use <code>session_id</code> and <code>session_name</code>?</p>
  
  <p>Thank you.</p>