xref: /PHP-5.6/ext/session/tests/009.phpt (revision 25e8fcc8)
1--TEST--
2unset($_SESSION["name"]); test
3--SKIPIF--
4<?php include('skipif.inc'); ?>
5--INI--
6session.use_cookies=0
7session.use_strict_mode=0
8session.cache_limiter=
9session.serialize_handler=php
10session.save_handler=files
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 $_SESSION["c"] does not contain any value
22session_id("abtest");
23session_start();
24var_dump($_SESSION);
25$_SESSION["name"] = "foo";
26var_dump($_SESSION);
27session_write_close();
28
29### Phase 3 $_SESSION["c"] is set
30session_start();
31var_dump($_SESSION);
32unset($_SESSION["name"]);
33var_dump($_SESSION);
34session_write_close();
35
36### Phase 4 final
37
38session_start();
39var_dump($_SESSION);
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
58