From efadf3dcd32d235981aa798ae826b8b7b38aa9b4 Mon Sep 17 00:00:00 2001 From: mark_story Date: Mon, 21 Jan 2013 20:46:41 -0500 Subject: [PATCH] Make sure sessions are started before destroying them. Fixes #3551 --- lib/Cake/Model/Datasource/CakeSession.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Cake/Model/Datasource/CakeSession.php b/lib/Cake/Model/Datasource/CakeSession.php index af457cdba..187857fca 100644 --- a/lib/Cake/Model/Datasource/CakeSession.php +++ b/lib/Cake/Model/Datasource/CakeSession.php @@ -421,9 +421,10 @@ class CakeSession { * @return void */ public static function destroy() { - if (self::started()) { - session_destroy(); + if (!self::started()) { + self::start(); } + session_destroy(); self::clear(); }