1--TEST--
2Test session_create_id() function : basic functionality
3--INI--
4session.save_handler=files
5session.sid_length=32
6--EXTENSIONS--
7session
8--SKIPIF--
9<?php include('skipif.inc'); ?>
10--FILE--
11<?php
12
13ob_start();
14
15echo "*** Testing session_create_id() : basic functionality ***\n";
16
17// No session
18var_dump(session_create_id());
19var_dump(session_create_id(''));
20var_dump(session_create_id(','));
21var_dump(session_create_id('-'));
22var_dump(session_create_id('0123456789'));
23var_dump(session_create_id('ABCD'));
24
25ini_set('session.use_strict_mode', true);
26$sid = session_create_id('XYZ');
27var_dump($sid);
28var_dump(session_id($sid));
29session_start();
30var_dump(session_id());
31var_dump(session_id() === $sid);
32session_destroy();
33
34ini_set('session.use_strict_mode', false);
35$sid = session_create_id('XYZ');
36var_dump($sid);
37var_dump(session_id($sid));
38session_start();
39var_dump(session_id());
40var_dump(session_id() === $sid);
41session_destroy();
42
43echo "Done";
44ob_end_flush();
45?>
46--EXPECTF--
47*** Testing session_create_id() : basic functionality ***
48string(32) "%s"
49string(32) "%s"
50string(33) ",%s"
51string(33) "-%s"
52string(42) "0123456789%s"
53string(36) "ABCD%s"
54string(35) "XYZ%s"
55string(0) ""
56string(32) "%s"
57bool(false)
58string(35) "XYZ%s"
59string(0) ""
60string(35) "XYZ%s"
61bool(true)
62Done
63