PHP 8.4.26 Released!

Yaf_Session::offsetUnset

(Yaf >=1.0.0)

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

Açıklama

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.

Bağımsız Değişkenler

name

The session key to remove.

Dönen Değerler

No value is returned.

Örnekler

Örnek 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"]));
?>

Yukarıdaki örnek şuna benzer bir çıktı üretir:

bool(false)

Ayrıca Bakınız

+add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top