title: How do I reset my Session id?
body: <p>I am trying to destroy a session after he makes successful payment . </p>
  
  <pre><code> $session_id = session_id();
  
      $sql = "
          UPDATE
              tbl_seat_book
          SET
              final_book = 'Y'
          WHERE
              session_id = '$session_id'
      ";
      $r = $this-&gt;db-&gt;executeQuery($sql);
  
          session_unset();
          session_destroy();
  
      echo 'Booking successfull';
  </code></pre>
  
  <p>But when I book tickets , the same <code>session_id</code> appears . How can I destroy the <code>session_id</code> after making successful payment .  </p>
  
  <p>EDIT :</p>
  
  <pre><code>$sql = "
          INSERT INTO
              tbl_seat_book
          SET
              booking_date = '$_REQUEST[bus_date]',
              booking_time = '$_REQUEST[bus_time]',
              bus_id = '$_REQUEST[bus_id]',
              route_id = '$_REQUEST[route_id]',
              session_id = '$session_id',
              session_start_time = '$time',
              temp_book = 'Y',
              final_book = 'N',
              $cond
      ";
      $booked = $this-&gt;db-&gt;insertQuery($sql);
  </code></pre>
  
  <p>EDIT2:</p>
  
  <pre><code>function book_final_tickets()
  {
  
      $session_id = session_id();
      $sql = "
          UPDATE
              tbl_seat_book
          SET
              final_book = 'Y'
          WHERE
              session_id = '$session_id'
      ";
  
  
      //session_unset();
  
      if($r = $this-&gt;db-&gt;executeQuery($sql)){
          if(session_destroy()){
              unset($session_id); 
              echo 'Booking successfull';
          }
      }
  }
  </code></pre>