xref: /PHP-8.2/ext/session/tests/027.phpt (revision b5a14e6c)
1--TEST--
2unset($_SESSION["name"]); should work
3--EXTENSIONS--
4session
5--SKIPIF--
6<?php include('skipif.inc'); ?>
7--INI--
8session.use_cookies=0
9session.use_strict_mode=0
10session.cache_limiter=
11session.serialize_handler=php
12session.save_handler=files
13--FILE--
14<?php
15error_reporting(E_ALL);
16ob_start();
17
18session_id("test027");
19
20### Phase 1 cleanup
21session_start();
22session_destroy();
23
24### Phase 2 $_SESSION["c"] does not contain any value
25session_id("test027");
26session_start();
27var_dump($_SESSION);
28$_SESSION["name"] = "foo";
29var_dump($_SESSION);
30session_write_close();
31
32### Phase 3 $_SESSION["c"] is set
33session_start();
34var_dump($_SESSION);
35unset($_SESSION["name"]);
36var_dump($_SESSION);
37session_write_close();
38
39### Phase 4 final
40
41session_start();
42var_dump($_SESSION);
43session_destroy();
44?>
45--EXPECT--
46array(0) {
47}
48array(1) {
49  ["name"]=>
50  string(3) "foo"
51}
52array(1) {
53  ["name"]=>
54  string(3) "foo"
55}
56array(0) {
57}
58array(0) {
59}
60