title: My PHP session won't save on hostgator
body: <p>Out of my head. How to fix this one. My session not working on hostgator server. But on other server it working fine.</p>
  
  <p>Here an example the code.</p>
  
  <pre><code>&lt;form action="/payment-select/" method="post"&gt;
   &lt;select name="payment" onchange="this.form.submit()"&gt;
   &lt;option value=""&lt;?php if(empty($_SESSION['payment'])) { echo ' selected="selected"'; } ?&gt;&gt;&lt;?php echo $lang_please_select; ?&gt;&lt;/option&gt;
   &lt;?php 
    $sp = 'SELECT * FROM payment';
    $qp   = $db-&gt;rq($sp);
    while($payment = $db-&gt;fetch($qp)) {
    ?&gt;
   &lt;option value="&lt;?php echo $payment['bank']; ?&gt;"&lt;?php if($_SESSION['payment'] == $payment['bank']) { echo ' selected="selected"'; } ?&gt;&gt;&lt;?php echo $payment['bank']; ?&gt;&lt;/option&gt;
   &lt;?php } ?&gt;
   &lt;/select&gt;
   &lt;/form&gt;
  </code></pre>
  
  <p>The <code>/payment-select/</code></p>
  
  <pre><code>include_once('includes/connection.php'); // session_start() here
  include_once('includes/formatting.php');
  
  $_SESSION['payment'] = strip_html_tags($_POST['payment']); 
  
  header("location:/payment/");
  exit();
  </code></pre>
  
  <p><strong>Update</strong></p>
  
  <ol>
  <li>All required pages have
  <code>session_start()</code> on the top.</li>
  <li>I install the script to <code>server A</code> working fine. Then <code>server B</code> fine.. But on <code>hostgator</code> with same phpinfo the <code>$_SESSION['payment']</code> won't save after header redirect to <code>/payment/</code> page.</li>
  </ol>
  
  <p><em>I'm not share the session between server. It's something like I install wordpress on server A ok, Server B ok and Server C problem. ( the situation by example )</em></p>