summaryrefslogtreecommitdiff
path: root/ext/session/tests/session_id_basic2.phpt
blob: 7a19696e611a97534648609f5e2c45f3cb213bc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
--TEST--
Test session_id() function : basic functionality
--SKIPIF--
<?php include('skipif.inc'); ?>
--FILE--
<?php

ob_start();

/*
 * Prototype : string session_id([string $id])
 * Description : Get and/or set the current session id
 * Source code : ext/session/session.c
 */

echo "*** Testing session_id() : basic functionality ***\n";

ini_set('session.sid_bits_per_chracter', 6);
ini_set('session.sid_length', 120);
session_start();
var_dump(session_id());
session_commit();

ini_set('session.sid_bits_per_chracter', 4);
ini_set('session.sid_length', 22);
session_start();
session_regenerate_id();
var_dump(session_id());
session_commit();

echo "Done";
?>
--EXPECTF--
*** Testing session_id() : basic functionality ***
string(120) "%s"
string(22) "%s"
Done