title: Session variables lost on new page
body: <p>I'm currently developing a web application for a client with the webspace hosted on one.com. </p>
  
  <p>I've implemented my own secure login system and everything works. When I log someone in, the variables are available but as soon as I go to a new page via an href all my session variables are lost. I've tried almost everything that is recommended on similar questions but it won't work. </p>
  
  <p>I can not edit my php.ini directly, this is the standard phpinfo: </p>
  
  <p><a href="http://i.stack.imgur.com/vJgRe.png" rel="nofollow">I can't embed Images yet, this is my phpinfo</a></p>
  
  <p>Additionally at the beginning of every site I call</p>
  
  <pre><code> ini_set("session.cookie_secure", 0);
  </code></pre>
  
  <p>Because at the beginning this was (locally) always set to true.</p>
  
  <p>I initiate a secure session on every page with the following code:</p>
  
  <pre><code>$session_name = 'sec_session_id';   // Set a custom session name
  $secure = true;
  // This stops JavaScript being able to access the session$id.
  $httponly = true;
  // Forces sessions to only use cookies.
  if (ini_set('session.use_only_cookies', 1) === FALSE) {
      header("Location: ../error.php?err=Could not initiate a safe session (ini_set)");
      exit();
  }
  // Gets current cookies params.
  $cookieParams = session_get_cookie_params();
  session_set_cookie_params($cookieParams["lifetime"],
      $cookieParams["path"], 
      $cookieParams["domain"], 
  
      $secure,
      $httponly);
  // Sets the session name to the one set above.
  session_name($session_name);
  session_start();            // Start the PHP session 
  session_regenerate_id(true);    // regenerated the session, delete the old one. 
  </code></pre>
  
  <p>I just dont understand why my Session variables are always lost. I would be happy about every help I can get!</p>
  
  <p><strong>Edit:</strong> Some suggestd that the last line:</p>
  
  <pre><code>session_regenerate_id(true);
  </code></pre>
  
  <p>Propably causes the problem but after removing it it still doesn't work. What else could it be?</p>