Exemplo n.º 1
0
	/**
	 * PHP >= 5.4.0<br/>
	 * Destroy a session
	 * @link http://php.net/manual/en/sessionhandlerinterafce.destroy.php
	 *
	 * @param int $session_id The session ID being destroyed.
	 *
	 * @return bool <p>
	 * The return value (usually TRUE on success, FALSE on failure).
	 * Note this value is returned internally to PHP for processing.
	 * </p>
	 */
	public function destroy($session_id) {
		// Low-level datasets are used here because they have less overhead than
		// the full-blown model system.
		$dataset = new Datamodel\Dataset();
		$dataset->table('session');
		$dataset->where('session_id = ' . $session_id);
		$dataset->where('ip_addr = ' . REMOTE_IP);

		$dataset->delete();
		$dataset->execute();

		// Blow away the current session data too!
		$_SESSION = null;
		self::$_IsReady = false;

		return true;
	}