title: PHP Session scope
body: <p>I have one <code>index.php</code> , <code>one.php</code> file.</p>
  
  <p>In one.php i have starting the session and setting the session var:</p>
  
  <pre><code>session_start(); 
  if(isset($_GET['user'])){
      $_SESSION['user'] = $_GET['user'];
      }
  function getUsername(){
    return $_SESSION['user'];
  }
  </code></pre>
  
  <p>Im including one.php in index.php after im calling the function  <code>getUsername()</code>
  im not starting session in <code>index.php</code></p>
  
  <pre><code>include_once('one.php');
  echo getUsername();
  </code></pre>
  
  <p>But im not getting the session in <code>index.php</code>. Why ? im passing the the variable as </p>
  
  <pre><code>index.php?user=newuser .
  </code></pre>
  
  <p>is it not possible to get the session in all pages with out starting session . is it any possible method to get a global variable from any where, if i set it once..?</p>