Yaf_Session::offsetUnset
PHP Manual
PHP Manual»Yaf_Session»Yaf_Session::offsetUnset

Yaf_Session::offsetUnset

(Yaf >=1.0.0)

Yaf_Session::offsetUnset — Remove a session key (ArrayAccess)

Beschreibung

public function Yaf_Session::offsetUnset(mixed $name): void

Removes a session key and its value. This method is called when unset() is used with array syntax on a session object.

Parameter-Liste

name

The session key to remove.

Rückgabewerte

No value is returned.

Beispiele

Beispiel #1 Yaf_Session::offsetUnset() example

<?php
$session = Yaf_Session::getInstance();
$session->start();

$session["captcha_code"] = "8X2Q";

// ... after verifying the captcha, drop the one-time code
unset($session["captcha_code"]);

var_dump(isset($session["captcha_code"]));
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

bool(false)

Siehe auch

To Top