xref: /PHP-7.4/ext/session/tests/009.phpt (revision 8882b28e)
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
11--FILE--
12<?php
13error_reporting(E_ALL);
14
15session_id("abtest");
16
17### Phase 1 cleanup
18session_start();
19session_destroy();
20
21### Phase 2 $HTTP_SESSION_VARS["c"] does not contain any value
22session_id("abtest");
23session_start();
24var_dump($HTTP_SESSION_VARS);
25$HTTP_SESSION_VARS["name"] = "foo";
26var_dump($HTTP_SESSION_VARS);
27session_write_close();
28
29### Phase 3 $HTTP_SESSION_VARS["c"] is set
30session_start();
31var_dump($HTTP_SESSION_VARS);
32unset($HTTP_SESSION_VARS["name"]);
33var_dump($HTTP_SESSION_VARS);
34session_write_close();
35
36### Phase 4 final
37
38session_start();
39var_dump($HTTP_SESSION_VARS);
40session_destroy();
41?>
42--EXPECT--
43array(0) {
44}
45array(1) {
46  ["name"]=>
47  string(3) "foo"
48}
49array(1) {
50  ["name"]=>
51  string(3) "foo"
52}
53array(0) {
54}
55array(0) {
56}
57