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