title: Windows Server having problems keeping my session after the next page load
body: <p>I'm going to share my basic configuration with hopes that somebody can clue in onto where my problem lies with my session variables.  The sessions are not saving in-between page loads, and for the life of my I cannot decide why.</p>
  
  <p>This is my first Windows PHP application that I'm building, so I'm at a loss right now after having tried everything I can think of.</p>
  
  <p>The session save path IS WRITABLE.  Verified using this code:</p>
  
  <pre><code>if (!is_writable(session_save_path()) ) {
      echo 'Session path "'.session_save_path().'" is not writable for PHP!'; 
  }
  </code></pre>
  
  <p>The <code>session.cookie_domain</code> is blank (not set to anything).  Again, this is correct based on my experience.</p>
  
  <p>I'm using <a href="https://github.com/anandkunal/ToroPHP" rel="nofollow">ToroPHP</a> as my simple router.  For my test, I simply route to a very simple class.  You'll see it below.</p>
  
  <p>Here is my Web.Config file.  This is what allows me to use <a href="https://github.com/anandkunal/ToroPHP" rel="nofollow">ToroPHP</a></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;configuration&gt;
      &lt;system.webServer&gt;
          &lt;rewrite&gt;
              &lt;rules&gt;
                  &lt;rule name="Toro" stopProcessing="true"&gt;
                      &lt;match url="^(.*)$" /&gt;
                      &lt;conditions logicalGrouping="MatchAll"&gt;
                          &lt;add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /&gt;
                          &lt;add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /&gt;
                      &lt;/conditions&gt;
                      &lt;action type="Rewrite" url="index.php/{R:1}" /&gt;
                  &lt;/rule&gt;
              &lt;/rules&gt;
          &lt;/rewrite&gt;
          &lt;httpErrors errorMode="Detailed" /&gt;
          &lt;asp scriptErrorSentToBrowser="true"/&gt;
      &lt;/system.webServer&gt;
          &lt;system.web&gt;
              &lt;customErrors mode="Off"/&gt;
              &lt;compilation debug="true"/&gt;
          &lt;/system.web&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Here is my configuration script, it's the very first thing called (besides setting my $ABS_SITE_PATH var):</p>
  
  <pre><code>error_reporting(E_ALL);
  ini_set('display_errors', 'On');
  //SET TIMEZONE
      date_default_timezone_set('America/New_York');
  
      $expireTime = 60 * 60 * 7 * 20; // 20 week expire time: seconds, minutes, days, weeks.
      ini_set('session.save_path', $ABS_SITE_PATH.'/sess');
      session_set_cookie_params($expireTime,"/",NULL, TRUE, TRUE);
      session_start();
  </code></pre>
  
  <p>And here is my simple test I'm performing:</p>
  
  <pre><code>class sessionTestHandler{
      public function get()
      {
  
          if (!isset($_SESSION['count'])) {
            $_SESSION['count'] = 0;
          } else {
            $_SESSION['count']++;
          }
          var_dump($_SESSION['count']);
      }
  }
  </code></pre>
  
  <p>I get <code>int(0)</code> output to my screen on every page load, no matter what.  If I var_dump the entire session variable, I get:  <code>array(1) { ["count"]=&gt; int(0) }</code></p>
  
  <p>If any additional information is needed I'll be happy to provide.  Thanks.</p>
  
  <p>UPDATE:
  This is across all browsers.</p>
  
  <p>UPDATE 1/14:
  On every page load, I am outputting <code>session_id();</code> and it shows a different ID on every load.  So the session ID is not persistent between page loads.</p>