1--TEST--
2Test basic function : variation2
3--INI--
4session.use_strict_mode=1
5session.save_handler=files
6session.hash_bits_per_character=4
7session.gc_probability=1
8session.gc_divisor=1000
9session.gc_maxlifetime=300
10session.save_path=
11session.sid_length=32
12session.name=PHPSESSID
13--EXTENSIONS--
14session
15--SKIPIF--
16<?php include('skipif.inc'); ?>
17--FILE--
18<?php
19
20ob_start();
21
22echo "*** Testing basic session functionality : variation2 ***\n";
23
24$session_id = 'session-basic2';
25session_id($session_id);
26$path = __DIR__;
27var_dump(session_save_path($path));
28
29echo "*** Without lazy_write ***\n";
30var_dump(session_id($session_id));
31var_dump(session_start(['lazy_write'=>FALSE]));
32$session_id_new1 = session_id();
33var_dump($session_id_new1 !== $session_id);
34var_dump(session_write_close());
35var_dump(session_id());
36
37echo "*** With lazy_write ***\n";
38var_dump(session_id($session_id));
39var_dump(session_start(['lazy_write'=>TRUE]));
40$session_id_new2 = session_id();
41var_dump($session_id_new1 !== $session_id_new2);
42var_dump(session_commit());
43var_dump(session_id());
44
45echo "*** Cleanup ***\n";
46ini_set('session.use_strict_mode',0);
47var_dump(session_id($session_id_new1));
48var_dump(session_start());
49var_dump(session_destroy());
50var_dump(session_id($session_id_new2));
51var_dump(session_start());
52var_dump(session_destroy());
53
54ob_end_flush();
55?>
56--EXPECTF--
57*** Testing basic session functionality : variation2 ***
58string(0) ""
59*** Without lazy_write ***
60string(14) "session-basic2"
61bool(true)
62bool(true)
63bool(true)
64string(32) "%s"
65*** With lazy_write ***
66string(32) "%s"
67bool(true)
68bool(true)
69bool(true)
70string(32) "%s"
71*** Cleanup ***
72string(32) "%s"
73bool(true)
74bool(true)
75string(0) ""
76bool(true)
77bool(true)
78