title: unable to get $_SESSION variable
body: <p><img src="https://i.stack.imgur.com/uQ1ml.png" alt="this error">
  <br>In <strong>Log-in.php</strong> I have</p>
  
  <pre><code>  $email=$_POST['email']; 
    $pass=$_POST['pass'];
    $_SESSION['type'] = 'user';
    $_SESSION['email'] = $email; 
    $_SESSION['pass']=$pass; 
    header('location:./connect.php');
  </code></pre>
  
  <p>I am getting error like
  <code>undefined index email</code> for other user log-in, at other side I can log-in as admin here.. </p>
  
  <p>I have a log-in form that see rather what kind of log-in is this and pass that type in session in this <strong>connect.php</strong> its check what kind of type it is and then proceed it was working well but unfortunately getting error can't modify anymore.</p>
  
  <p>log-in form is one form for user, admin and agents, where I am able to log-in as admin but I am not able to login as other it shows error</p>
  
  <pre><code>if(empty($_SESSION))
  {
     session_regenerate_id();
     session_start();
  }
  @mysql_connect('localhost','root','') or die("ERROR in SERVER");
  @mysql_select_db('module') or die("ERROR IN DATABASE");
  
      $_SESSION['start'] = time(); // taking now logged in time
  
      if(!isset($_SESSION['expire'])){
          $_SESSION['expire'] = $_SESSION['start'] + (60* 60) ; // ending a session in 30 seconds
      }
      $now = time(); // checking the time now when home page starts
  
      if($now &gt; $_SESSION['expire'])
      {
          session_destroy();
  
      }
  
  if(!empty($_SESSION['type']))
  {
  $email = $_SESSION['email'];
  $pass = $_SESSION['pass'];
  $type = $_SESSION['type'];
  
  
  // admin login //
  if($type == 'admin'){
  
  
  
  
  $admin = mysql_query("SELECT * FROM `admin` WHERE `email` ='$email' ");
  $res = mysql_fetch_array($admin);
  if($email == "" || $pass == "" || $email != $res['email'] || $pass != $res['pass'])
  {
      header('location:./login/login.php');
  }
  
  }
  
  
  // user login //
  if($type == 'user')
  {
       $email = $_SESSION['email'];
       $pass = $_SESSION['pass'];
       $type = $_SESSION['type'];
      $user = mysql_query("SELECT `id` FROM `users` WHERE `email`='$email' AND `status`='1'");
      $useres = mysql_fetch_array($user);
     // $trail = $useres['date'];
    //  $time = explode("/",$trail);
  
  
      if($email != $useres['email'] || $pass != $useres['pass'])
  
      {
          echo mysql_error();
  //        header('location:./login/login.php');
      }
  
      else if($pass = $useres['pass']){
  //        echo '&lt;script&gt; location.replace("./user.php"); &lt;/script&gt;';
      }
  }
  
  
  // agent login //
  if($type == 'agent')
  {
  
      $email = $_SESSION['email'];
       $pass = $_SESSION['pass'];
       $type = $_SESSION['type'];
      $agent = mysql_query("SELECT `id` FROM `sale_agents` WHERE `email`='$email'");
      $agentres = mysql_fetch_array($agent);
      if($email != $agentres['email'] || $pass != $agentres['pass'])
      {
          header('location:./login/login.php');
  
      }
      else if($pass = $agentres['pass']){
     //     echo '&lt;script&gt; location.replace("./agent.php"); &lt;/script&gt;';
      }
  }
  }
  else{
      header('location:./login/login.php');
  }
  </code></pre>
  
  <p>In one way I am getting error in other way page is also displaying email 
  <strong>what to do now?</strong> 
  <img src="https://i.stack.imgur.com/0zYMT.png" alt="enter image description here"></p>