Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Cleaned up the session closing stuff a bit

  • Loading branch information...
commit a9d05304bc89da049e18a53f6ad69ae4921c8695 1 parent 0bc2007
Rik authored

Showing 2 changed files with 11 additions and 1 deletion. Show diff stats Hide diff stats

  1. +6 1 http/SessionStorage.php
  2. +5 0 http/SessionStorageDb.php
7 http/SessionStorage.php
@@ -73,8 +73,13 @@ public function start()
73 73 */
74 74 public function closeAndWrite()
75 75 {
  76 + // Stop if we were started
  77 + if ($this->started) {
  78 + session_write_close();
  79 + }
  80 +
  81 + // make sure we are stopped
76 82 $this->started = false;
77   - session_write_close();
78 83 }
79 84
80 85
5 http/SessionStorageDb.php
@@ -116,6 +116,11 @@ public function read($sessionID)
116 116 */
117 117 public function write($sessionID, $data)
118 118 {
  119 + // If we've been stopped, don't do anything.
  120 + if (!$this->started) {
  121 + return true;
  122 + }
  123 +
119 124 // prepare the data for the query
120 125 $param = array(
121 126 'id' => $sessionID,

0 comments on commit a9d0530

Please sign in to comment.
Something went wrong with that request. Please try again.