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