Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Cleaned up the session closing stuff a bit

  • Loading branch information...
commit a9d05304bc89da049e18a53f6ad69ae4921c8695 1 parent 0bc2007
@rikh42 authored
Showing with 11 additions and 1 deletion.
  1. +6 −1 http/SessionStorage.php
  2. +5 −0 http/SessionStorageDb.php
View
7 http/SessionStorage.php
@@ -73,8 +73,13 @@ public function start()
*/
public function closeAndWrite()
{
+ // Stop if we were started
+ if ($this->started) {
+ session_write_close();
+ }
+
+ // make sure we are stopped
$this->started = false;
- session_write_close();
}
View
5 http/SessionStorageDb.php
@@ -116,6 +116,11 @@ public function read($sessionID)
*/
public function write($sessionID, $data)
{
+ // If we've been stopped, don't do anything.
+ if (!$this->started) {
+ return true;
+ }
+
// prepare the data for the query
$param = array(
'id' => $sessionID,
Please sign in to comment.
Something went wrong with that request. Please try again.