Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<Yaf_Session::startYaf_Session::valid>
^Yaf_SessionLast updated: Mon, 26 Oct 2026

Yaf_Session::__unset

(Yaf >=1.0.0)

Yaf_Session::__unset — Remove a session key

Description

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.

Parameters

name

The session key to remove.

Return Values

No value is returned.

Examples

Example #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));
?>

The above example will output something similar to:

bool(false)

See Also


<Yaf_Session::startYaf_Session::valid>
^Yaf_SessionLast updated: Mon, 26 Oct 2026