title: PHP and session
body: <p>I have strange problem with sessions. In my small admin panel for my site there were some pages, 6 in fact. All worked nice. But in time I added one more page and when I go to that one firstly I see the content and after refreshing page or going to another one I'm thrown out from the account. Cookies are not deleted. It seems that session is destroyed but there is no any work with sessions. That is just infomartion page where some data from db is displayed.</p>
  
  <p>This is code from index.php where session starts:</p>
  
  <pre><code>ini_set('session.gc_maxlifetime', 3600);
  ini_set('session.cookie_lifetime', 3600);
  session_start(); 
  ...
  </code></pre>
  
  <p>And this code from problem page 'orders.php':</p>
  
  <pre><code>$res = $administrator-&gt;getOrders();
  while($order = mysql_fetch_array($res, MYSQL_ASSOC)) {
     filtrate and print data from db in a table
  }
  </code></pre>
  
  <p>Do you have any assumptions? I have not, was searching for an error for 2 days ;(</p>
  
  <p>Check authorization function: </p>
  
  <pre><code>public function checkLogin() {
      if(isset($_SESSION['hash']) &amp;&amp; isset($_SESSION['id'])) {
      $id = intval($_SESSION['id']);
      $where = "`id`='$id'";
      $cookie = DBWorking::getFieldWhere('cookie', 'users', $where);
      $hash = mysql_fetch_assoc($cookie);
      if($_SESSION['hash'] === $hash['cookie']) {
          return true;
      }
  }
  return false;
  } 
  </code></pre>