Destroys a redundant session

@param type $id
@param type $restart
508261
final public function destroy($id = "")
    {

        $id = !empty($id) ? $id : $this->getId();
        $now = time();

        if (empty($id)) {
            return false;
        }

        setcookie(session_name(), '', $now - 42000, '/');

        if (session_id()) {
            @session_unset();
            @session_destroy();
        }

        //Delete from db;
        //Do a garbage collection
        $this->gc($id);
    }
536337
public function handleDeleteRole(int $id): void
	{
		if ($this->isAjax()) {
			$role = $this->orm->aclRoles->getById($id);
			$this->orm->aclRoles->removeAndFlush($role);
			$this['rolesList']->reload();
		} else {
			$this->terminate();
		}
	}
1336672
public function destroy($id)
    {
        $admin = $this->adminRepository->find($id);

        if (!is_null($admin)) {
            $this->adminRepository->destroy($admin);
        }

        return Redirect::route('admin.admin.index');
    }
1132995
public function renew(int $id)
    {
        $this->updates[$id] = $this->now + $this->timeout;
    }
879294
public function handleDeletePermission(int $id): void
	{
		if ($this->isAjax()) {
			$permission = $this->orm->acl->getById($id);
			$this->orm->acl->removeAndFlush($permission);
			$this['permissionsList']->reload();
		} else {
			$this->terminate();
		}
	}
49752
public static function destroy($id) 
    {
        try {
            $file = self::find($id);
            
            if($file->descendants()->exists()) {
                foreach($file->descendants()->where('type', '!=', 'folder')->get() as $descendant) {
                    
                    event(new FileWasDeleted([ // fire 'file deleted' event for each descendant
                        'file' => $descendant
                    ]));
                }
            }
            
            $file->delete($id);

            if($file->type != 'folder') {
                event(new FileWasDeleted([ // fire 'file deleted' event for file
                    'file' => $file
                ]));
            }
        }
        
        catch (Exception $e) {
            throw $e;
        }
    }
235434
public function handleDelete(int $id): void
	{
		if ($this->isAjax()) {
			$page = $this->orm->pages->getById($id);
			$parent = $page->parent;
			$this->orm->pages->removeAndFlush($page);
			if ($parent !== null) {
				$this['list']->setDataSource($this->orm->pages->findById($parent->id));
				$this['list']->redrawItem($parent->id);
			} else {
				$this['list']->redrawControl();
			}
		} else {
			$this->terminate();
		}
	}
779906
public static function logout($id = null)
    {
        if (!$id) $id = \Zend_Auth::getInstance()->getIdentity();
        if (!$id) return;
        self::getDbConnection()->executeQuery("DELETE FROM users_auth WHERE user_id=".$id['user_id']." and uniq='".$id['uniq']."'");
        \Zend_Auth::getInstance()->clearIdentity();
		\Zend_Session::forgetMe();		
    }
939962
public function deleteTable($id)
    {
        if (isset($this[$id])) {
            Common::destroy($this[$id]);
            $this->setTableDeleted($id);
        }
    }
591118
public function destroy($id)
    {
        $this->model->findOrFail($id)->delete();

        $this->notify([
            'type' => 'danger',
            'title' => 'Successful deleted Role!',
            'description' => 'The role is deleted successfully.',
        ]);

        return redirect()->back();
    }
1275622
public function destroy($id)
    {
        $files = $this->repository->find($id);

        if (empty($files)) {
            Cms::notification('File not found', 'warning');

            return redirect(route($this->routeBase.'.files.index'));
        }

        if (is_file(storage_path($files->location))) {
            Storage::delete($files->location);
        } else {
            Storage::disk(config('cms.storage-location', 'local'))->delete($files->location);
        }

        $files->delete();

        Cms::notification('File deleted successfully.', 'success');

        return redirect(route($this->routeBase.'.files.index'));
    }
1250756
private function destroyBinding($id)
    {
        unset($this->cache[$id], $this->bindings[$id], $this->aliases[$id]);
    }
501693
public function destroy($id)
    {
        $scheduler = Scheduler::findOrFail($id);

        $scheduler->history()->delete();
        $scheduler->delete();

        return redirect(route('eyewitness.dashboard').'#scheduler')->withSuccess('The scheduler has been deleted.');
    }
579262
public function destroy($id)
	{
		$entity = UUID::findOrFail($id)->entity;
		return ResourceController::resolveController($entity)->destroy($entity);
	}
970056
public function destroy($id)
    {
        $user = $this->user->findOrFail($id);

        if($user->delete()) return response()->json(['status' => 'ok']);

        return response()->json(['status' => 'failed']);
    }
1172918
public function destroy($id)
      {
        Permission::destroy($id);
        \Session::flash('flash_message', 'Permission deleted!');
        return \Redirect::route('admin.permissions.index', [
          ])->withMessage(trans('acl::permission.permissions-controller-successfully_deleted'));
        }
816032
public function destroy($id)
    {
        // Get the first permission that is not this one that we are trying to delete
        $default_permission = Role::findOrFail(1);

        // Build users model based on Auth config model
        $user_model = config('auth.model');
        // Update all the users that have this role. Assign them the default role.
        $user_model::where('role_id', '=', $id)
                   ->update(['role_id' => $default_permission->id]);

        // Delete the requested role.
        $role = Role::findOrFail($id);
        $role->delete();

        return redirect()->action('\Aginev\Acl\Http\Controllers\RoleController@index')
                         ->with('success', trans('acl::role.destroy.deleted'));
    }