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