/** * 移除所有Session数据 */ public static function removeAll() { Base::checkOpen(); if (Base::driver() == 'file') { $_SESSION = []; return; } $data = self::getAll(); $session = Base::getSessionObject(); foreach ($data as $index => $value) { $session->remove($index); } }