1--TEST--
2Test session_reset() function : basic functionality
3--SKIPIF--
4<?php include('skipif.inc'); ?>
5--INI--
6session.save_path=
7session.name=PHPSESSID
8session.save_handler=files
9--FILE--
10<?php
11
12ob_start();
13
14/*
15 * Prototype : void session_reset(void)
16 * Description : Should abort session. Session data should not be written.
17 * Source code : ext/session/session.c
18 */
19
20echo "*** Testing session_abort() : basic functionality ***\n";
21
22session_start();
23$session_id = session_id();
24$_SESSION['foo'] = 123;
25session_commit();
26
27session_id($session_id);
28session_start();
29$_SESSION['bar'] = 456;
30var_dump($_SESSION);
31session_reset();
32
33var_dump($_SESSION); // Should only have 'foo'
34
35echo "Done".PHP_EOL;
36
37?>
38--EXPECTF--
39*** Testing session_abort() : basic functionality ***
40array(2) {
41  ["foo"]=>
42  int(123)
43  ["bar"]=>
44  int(456)
45}
46array(1) {
47  ["foo"]=>
48  int(123)
49}
50Done
51