summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorjvoisin2018-12-26 12:14:47 +0100
committerjvoisin2018-12-26 12:14:47 +0100
commit63898e19a2050cb797e8f36e7389dbb553343af7 (patch)
treed67428d1e466cd1733a95fd4cf015008ad31255e /src/tests
parent2ca73d842719c1c8002a20fbbc93c57d1308d54e (diff)
Remove an unnecessary guard against infinite recursion in session handling
This used to be useful in the times of PHP5.4/Suhosin (https://github.com/sektioneins/suhosin/issues/60), but nowadays, php is handling this case on its own.
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/set_custom_session_handler2.phpt36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/tests/set_custom_session_handler2.phpt b/src/tests/set_custom_session_handler2.phpt
new file mode 100644
index 0000000..ecd40ea
--- /dev/null
+++ b/src/tests/set_custom_session_handler2.phpt
@@ -0,0 +1,36 @@
1--TEST--
2Set a custom session handler, twice
3--SKIPIF--
4<?php if (!extension_loaded("snuffleupagus")) die "skip"; ?>
5--INI--
6sp.configuration_file={PWD}/config/config_crypt_session.ini
7session.save_path = "/tmp"
8--ENV--
9return <<<EOF
10REMOTE_ADDR=127.0.0.1
11EOF;
12--FILE--
13<?php
14session_set_save_handler(new SessionHandler(), true);
15session_start();
16$_SESSION['a'] = 'b';
17#var_dump($_SESSION);
18session_destroy();
19session_set_save_handler(new SessionHandler(), true);
20session_start();
21$_SESSION['a'] = 'b';
22var_dump($_SESSION);
23session_destroy();
24?>
25--EXPECTF--
26Warning: SessionHandler::open(): Cannot call session save handler in a recursive manner in%s/tests/set_custom_session_handler2.php on line 8
27
28Warning: SessionHandler::close(): Cannot call session save handler in a recursive manner in %stests/set_custom_session_handler2.php on line 8
29
30Warning: session_start(): Failed to initialize storage module: user (path: %s) in %stests/set_custom_session_handler2.php on line 8
31array(1) {
32 ["a"]=>
33 string(1) "b"
34}
35
36Warning: session_destroy(): Trying to destroy uninitialized session in %s/tests/set_custom_session_handler2.php on line %d