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