title: PHP - Losing session in IE and Chrome
body: <p>I have a big problem with losing session in my PHP code. I have 3 form (like a 3 steps), when I'm going from 2. to 3. session loses my data from 1. to 2. step. It gives me only current elements from 2. to 3.</p>
  
  <p>Really I don't know what is the reason... :(
  I tried yesterday by 10h...</p>
  
  <p>This problem is on IE and Chrome, in Opera it's working normally.</p>
  
  <p>I was looking for in Google:</p>
  
  <blockquote>
    <p>chrome loses session variables between pages</p>
  </blockquote>
  
  <p>I found three websites:</p>
  
  <p><a href="http://weblogs.asp.net/nannettethacker/archive/2012/11/09/google-chrome-loses-asp-net-sessions-need-favicon.aspx" rel="nofollow noreferrer">1. Link - about favicon.ico</a> - after added, nothing helped...</p>
  
  <p><a href="https://stackoverflow.com/questions/8247842/session-data-lost-in-chrome-only">2. SOF - similar problem</a> - but also nothing...</p>
  
  <p>I tried add to code:</p>
  
  <pre><code>session_write_close();
  session_save_path('/homez.764/name/tmp/');
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/2953536/randomly-losing-session-variables-only-in-google-chrome-url-rewriting">HTACCESS on SOF</a>:</p>
  
  <p>.htaccess also does't help (about favicon):</p>
  
  <pre><code>#&lt;IfModule mod_rewrite.c&gt;
  Options +FollowSymlinks
  RewriteEngine on
  RewriteCond %{REQUEST_URI} !^/.*(themes|wysiwyg|images|js)/
  RewriteRule ^favicon.ico$ favicon.ico [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-l
  RewriteRule .* index.php
  #&lt;/IfModule&gt;
  </code></pre>
  
  <p>(Yes, I use session_start() on every site)</p>
  
  <p>Please, help me if you can, I've never spent so much time on the forms...</p>
  
  <p>Thanks in advance!</p>
  
  <p>---- EDIT 09:38 ----:</p>
  
  <p>on 2. page session array:</p>
  
  <blockquote>
    <p>Array ( [krajnadania] => Anglia [nadanie] => 10 [doreczenie] => Polska
    [odbior] => Sobota [ilosc] => 1 [waga] => 1 [wys] => 1 [gleb] => 1
    [szer] => 1 [wynik] => 5.00 [koszt] => [zawartosc] => [uwagi] => )</p>
  </blockquote>
  
  <p>on 3. page:</p>
  
  <blockquote>
    <p>Array ( [krajnadania] => [nadanie] => [doreczenie] => [odbior] =>
    [ilosc] => [waga] => [wys] => [gleb] => [szer] => [wynik] => [koszt]
    => 20 £ [zawartosc] => Sth1 [uwagi] => Sth12 )</p>
  </blockquote>
  
  <p>CODE:</p>
  
  <p>Second page:</p>
  
  <blockquote>
  <pre><code>session_start();
  
  $_SESSION['krajnadania'] = $_POST['krajnadania'];
  $_SESSION['nadanie'] = $_POST['nadanie'];
  $_SESSION['doreczenie'] = $_POST['doreczenie'];
  $_SESSION['odbior'] = $_POST['odbior'];
  $_SESSION['ilosc'] = $_POST['ilosc'];
  $_SESSION['waga'] = $_POST['waga'];
  $_SESSION['wys'] = $_POST['wys'];
  $_SESSION['gleb'] = $_POST['gleb'];
  $_SESSION['szer'] = $_POST['szer'];
  $_SESSION['wynik'] = $_POST['wynik'];
  print_r($_SESSION);
  </code></pre>
  </blockquote>
  
  <p>Third page:</p>
  
  <blockquote>
  <pre><code>session_start();
  
  $_SESSION['koszt'] = $_POST['koszt'];
  $_SESSION['zawartosc'] = $_POST['zawartosc'];
  $_SESSION['uwagi'] = $_POST['uwagi'];
  print_r($_SESSION);
  </code></pre>
  </blockquote>
  
  <p>---- EDIT 14:04 ----:</p>
  
  <p>Amazing, but problem is still... I wrote session var 'sth' in 1. file  </p>
  
  <pre><code>&lt;?php
  session_start();
  
  $_SESSION['sth'] = 'STH';
  print_r($_SESSION);
  ?&gt;
  </code></pre>
  
  <p>and i print session on every page, this is the effect:</p>
  
  <p>1:</p>
  
  <blockquote>
    <p>Array ( [sth] => STH [krajnadania] =>
    [nadanie] => [doreczenie] => [odbior] => [ilosc] => [waga] => [wys] =>
    [gleb] => [szer] => [wynik] => [koszt] => [zawartosc] => [uwagi] => )</p>
  </blockquote>
  
  <p>2:</p>
  
  <blockquote>
    <p>Array ( [sth] => STH [krajnadania] => Anglia [nadanie] => 10 [doreczenie] => Polska
    [odbior] => Sobota [ilosc] => 2 [waga] => 1 [wys] => 1 [gleb] => 1
    [szer] => 1 [wynik] => 5.00 [koszt] => [zawartosc] => [uwagi] => )</p>
  </blockquote>
  
  <p>3:</p>
  
  <blockquote>
    <p>Array ( [sth] => STH [krajnadania] => [nadanie] => [doreczenie] =>
    [odbior] => [ilosc] => [waga] => [wys] => [gleb] => [szer] => [wynik]
    => [koszt] => 40 £ [zawartosc] => cos2 [uwagi] => cos1 )</p>
  </blockquote>
  
  <p>$_SESSION['sth'] is visible for every page and it is not clearing...</p>
  
  <p><strong>---- EDIT 17:28 ----:</strong></p>
  
  <p>I found probably the cause of this problem. When I deleted all include files in my index.php it started to work. Later I included step by step files and...</p>
  
  <p>When I have nivo-slider (jQuery images slider) it is not working, when I delete lines:</p>
  
  <pre><code>&lt;div class="slider-wrapper theme-default"&gt;
  &lt;div id="slider1" class="nivoSlider"&gt;
  &lt;img src="images/1.jpg" data-transition="fade" alt="" border="0" /&gt;
  &lt;img src="images/2.jpg" data-transition="fade" alt="" border="0" /&gt;
  &lt;img src="images/3.jpg" data-transition="fade" alt="" border="0" /&gt;
  &lt;img src="images/4.jpg" data-transition="fade" alt="" border="0" /&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Sessions are working :) I'm still looking for the problem.</p>