xref: /php-src/ext/session/tests/deprecations.phpt (revision c5bce0d8)
1--TEST--
2Deprecated GET/POST sessions
3--EXTENSIONS--
4session
5--SKIPIF--
6<?php include 'skipif.inc'; ?>
7--INI--
8session.use_cookies=0
9session.use_only_cookies=1
10session.use_trans_sid=0
11--FILE--
12<?php
13
14ob_start();
15
16// Expecting deprecation here
17ini_set("session.use_only_cookies", "0");
18// Expecting no deprecation
19ini_set("session.use_only_cookies", "1");
20
21// Expecting deprecation here
22ini_set("session.use_trans_sid", "1");
23// Expecting no deprecation
24ini_set("session.use_trans_sid", "0");
25
26// Expecting deprecation here
27ini_set("session.trans_sid_tags", "a=href");
28// Expecting no deprecation (default value)
29ini_set("session.trans_sid_tags", "a=href,area=href,frame=src,form=");
30
31// Expecting deprecation here
32ini_set("session.trans_sid_hosts", "php.net");
33// Expecting no deprecation (default value)
34ini_set("session.trans_sid_hosts", "");
35
36// Expecting deprecation here
37ini_set("session.referer_check", "php.net");
38// Expecting no deprecation (default value)
39ini_set("session.referer_check", "");
40
41// Setting deprecated values directly in session_start()
42// Expecting deprecation here
43session_start([ 'use_cookies' => '0', 'use_only_cookies' => '0', 'use_trans_sid' => '1']);
44
45echo SID;
46
47?>
48--EXPECTF--
49Deprecated: ini_set(): Disabling session.use_only_cookies INI setting is deprecated in %s on line 6
50
51Deprecated: ini_set(): Enabling session.use_trans_sid INI setting is deprecated in %s on line 11
52
53Deprecated: ini_set(): Usage of session.trans_sid_tags INI setting is deprecated in %s on line 16
54
55Deprecated: ini_set(): Usage of session.trans_sid_hosts INI setting is deprecated in %s on line 21
56
57Deprecated: ini_set(): Usage of session.referer_check INI setting is deprecated in %s on line 26
58
59Deprecated: session_start(): Disabling session.use_only_cookies INI setting is deprecated in %s on line 32
60
61Deprecated: session_start(): Enabling session.use_trans_sid INI setting is deprecated in %s on line 32
62
63Deprecated: Constant SID is deprecated in %s on line 34
64PHPSESSID=%s
65