Make sure sessions are started before destroying them.

Fixes #3551
This commit is contained in:
mark_story 2013-01-21 20:46:41 -05:00
parent 622d2f04f9
commit efadf3dcd3

View file

@ -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();
}