PHP 8.6.0 Beta 3 is available for testing

Yaf_Session::__unset

(Yaf >=1.0.0)

Yaf_Session::__unsetRemove a session key

Beschreibung

public function Yaf_Session::__unset(string $name): void

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

Parameter-Liste

name

The session key to remove.

Rückgabewerte

No value is returned.

Beispiele

Beispiel #1 Yaf_Session::__unset() example

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

$session->user_id = 42;

// ... when the user logs out
unset($session->user_id);

var_dump(isset($session->user_id));
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

bool(false)

Siehe auch

add a note

User Contributed Notes

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