From 2c0ec63dd91e60d6d2403273417cc04ff45cdb81 Mon Sep 17 00:00:00 2001 From: Robin Wouters Date: Thu, 13 Mar 2014 13:02:25 +0100 Subject: [PATCH] Fixed bug in conflicting session ids, fixed a bug in generating cookie string --- libraries/Curl.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libraries/Curl.php b/libraries/Curl.php index f75826e..32d4bf9 100644 --- a/libraries/Curl.php +++ b/libraries/Curl.php @@ -185,7 +185,7 @@ public function set_cookies($params = array()) { if (is_array($params)) { - $params = http_build_query($params, NULL, '&'); + $params = http_build_query($params, NULL, ';'); } $this->option(CURLOPT_COOKIE, $params); @@ -317,9 +317,16 @@ public function execute() } $this->options(); - + + // Temp close session to prevent conflicting sessions + session_write_close(); + // Execute the request & and hide all output $this->response = curl_exec($this->session); + + // Restart session + session_start(); + $this->info = curl_getinfo($this->session); // Request failed