title: Reload page, keep sessions
body: <p>I'm trying to develop a function where a user can click "Previos week"/"Next week" and that will trigger some <code>$_SESSION</code> variables to change values (dates).</p>
  
  <p>I have this code on <strong>absence.php</strong> (I know that PRG pattern is not implemented. I have no idea on how to do this but still keep functionality).</p>
  
  <pre><code>&lt;?php
  if (isset($_POST['decrease_date'])) {
      $monday_value = ($_SESSION['sess_mon'] = strftime("%Y-%m-%d", strtotime("{$_SESSION['sess_mon']} -1 day")) );
  }
  if (isset($_POST['increase_date'])) {
      $monday_value = ($_SESSION['sess_mon'] = strftime("%Y-%m-%d", strtotime("{$_SESSION['sess_mon']} +1 day")) );
  }
  else {
      $monday_value = ($_SESSION['sess_mon'] = date('Y-m-d', strtotime('Monday this week')) );
  }
  ?&gt;
  
   &lt;form action='absence.php' method='post'&gt;
    &lt;input type="hidden" name="decrease_date"/&gt;
    &lt;input type='submit' value='Previous'&gt;
   &lt;/form&gt;
  
  &lt;form action='absence.php' method='post'&gt;
   &lt;input type="hidden" name="increase_date"/&gt;
  &lt;input type='submit' value='Next'&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Now I would like to reload the page (with jQuery <code>location.reload()</code>-function) but still keep the <code>$_SESSION</code>s what was active at the moment before the page was refreshed. Currently this will "reset" since there is no <code>$_POST</code>.</p>
  
  <p>Ideally I would like to send the <code>&lt;form action'#'&gt;</code> to another page. However when you first enter <strong>absence.php</strong> the dates should be reset.</p>
  
  <p>How would I do this?</p>