diff options
-rw-r--r-- | modules/gallery/controllers/file_proxy.php | 3 | ||||
-rw-r--r-- | system/libraries/Session.php | 13 | ||||
-rw-r--r-- | system/libraries/drivers/Session/Database.php | 4 |
3 files changed, 20 insertions, 0 deletions
diff --git a/modules/gallery/controllers/file_proxy.php b/modules/gallery/controllers/file_proxy.php index 1f885e53..0d64bcd9 100644 --- a/modules/gallery/controllers/file_proxy.php +++ b/modules/gallery/controllers/file_proxy.php @@ -112,6 +112,9 @@ class File_Proxy_Controller extends Controller { kohana::show_404(); } + // We don't need to save the session for this request + Session::abort_save(); + // Dump out the image header("Content-Type: $item->mime_type"); Kohana::close_buffers(false); diff --git a/system/libraries/Session.php b/system/libraries/Session.php index e03f5dff..61a0d403 100644 --- a/system/libraries/Session.php +++ b/system/libraries/Session.php @@ -27,6 +27,9 @@ class Session_Core { // Input library protected $input; + // Automatically save the session by default + public static $should_save = true; + /** * Singleton instance of Session. */ @@ -455,4 +458,14 @@ class Session_Core { } } + /** + * Do not save this session. + * + * @return void + */ + public function abort_save() { + Session::$should_save = false; + + } + } // End Session Class diff --git a/system/libraries/drivers/Session/Database.php b/system/libraries/drivers/Session/Database.php index b4144ffb..b8993a9e 100644 --- a/system/libraries/drivers/Session/Database.php +++ b/system/libraries/drivers/Session/Database.php @@ -98,6 +98,10 @@ class Session_Database_Driver implements Session_Driver { public function write($id, $data) { + if (!Session::$should_save) { + return true; + } + $data = array ( 'session_id' => $id, |