1--TEST--
2Test session_abort() 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_abort(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_abort();
32
33session_id($session_id);
34session_start();
35var_dump($_SESSION); // Should only have 'foo'
36
37echo "Done".PHP_EOL;
38
39?>
40--EXPECTF--
41*** Testing session_abort() : basic functionality ***
42array(2) {
43  ["foo"]=>
44  int(123)
45  ["bar"]=>
46  int(456)
47}
48array(1) {
49  ["foo"]=>
50  int(123)
51}
52Done
53