title: why $_POST is not changing Session?
body: <p>Hello i get crazy through a script that i would like to build.</p>
  
  <p>The logic behind everything:</p>
  
  <p>I have a page on that I use sessions. Now the first time a user enters the site it will look if there is a <code>http_accept_language</code>. In that case a session will be created and the preferred language will saved. If there is no setting in the browser, it will be done by hand as a default language setting. Afterwards it will be direct to the correct path.</p>
  
  <p>so I have this part:</p>
  
  <pre class="lang-php prettyprint-override"><code>if (!isset($_SESSION['pref_lang'])){
      if (isset($_SERVER["HTTP_ACCEPT_LANGUAGE"])){
          $max   = 0.0;
          $languages = explode(",", (strtolower($_SERVER["HTTP_ACCEPT_LANGUAGE"])));
          foreach($languages as $language){
              $language = explode(';', $language);
              $q    = (isset($language[1])) ? ((float) $language[1]) : 1.0;
              if ($q &gt; $max){
                  $max = $q;
                  $pref_language = $language[0];
              }
          }
          $pref_language = trim($pref_language);
      }
      elseif (!isset($_SERVER["HTTP_ACCEPT_LANGUAGE"])){
          $pref_language = "en";  
      }
  $_SESSION['pref_lang'] = $pref_language;
  $pref_language = $_SESSION['pref_lang'];
      if ($basename === "index" ){
          header ('Location: http://www.domain.com/'.$pref_language.'/'.$basename);
      }
  }
  </code></pre>
  
  <p>now in case of that the session already exists i would like to give an option to change language-settings on every site. therefor i have in two different footers that will be included by php and depending from the $pref_language but all include the same part:</p>
  
  <pre><code>&lt;form action="'.$_SERVER['PHP_SELF'].'" method="post"&gt;      
      &lt;input type="submit" id="de" name="de"/&gt;&lt;div&gt;german/div&gt;
  &lt;/form&gt;
  &lt;form action="'.$_SERVER['PHP_SELF'].'" method="post"&gt;  
      &lt;input type="submit" id="en" name="fr"/&gt;&lt;div&gt;french&lt;/div&gt;
  &lt;/form&gt;and so on...
  </code></pre>
  
  <p>and on top the php parser:</p>
  
  <pre><code>if (isset($_SESSION['pref_lang'])){ 
      if (isset($_POST["de"]) ){
          $pref_language = "de";
          $_SESSION['pref_lang'] = $pref_language;
          var_dump($_POST);
      }
      elseif (isset($_POST["fr"]) ){
          $pref_language = "fr";
          $_SESSION['pref_lang'] = $pref_language;
          var_dump($_POST);
      }
  }
  echo "session exist:".$_SESSION['pref_lang']."&lt;br/&gt;";
  $pref_language = $_SESSION['pref_lang'];
  var_dump($_POST);
  }
  </code></pre>
  
  <p>now when calling a page and pressing the button to change the language it will echo for var_dump:</p>
  
  <pre><code>array(1) { ["fr"]=&gt; string(2) "fr" } 
  </code></pre>
  
  <p>but when calling the session via print_r on an other blank page, it wont have changed. even when reloading the url, it will be set back to default. </p>
  
  <p>so if there is someone who could give me a hint to solve that i really would apreciate.</p>