diff options
| author | jvoisin | 2018-12-26 12:14:47 +0100 |
|---|---|---|
| committer | jvoisin | 2018-12-26 12:14:47 +0100 |
| commit | 63898e19a2050cb797e8f36e7389dbb553343af7 (patch) | |
| tree | d67428d1e466cd1733a95fd4cf015008ad31255e /src/tests | |
| parent | 2ca73d842719c1c8002a20fbbc93c57d1308d54e (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.phpt | 36 |
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-- | ||
| 2 | Set a custom session handler, twice | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!extension_loaded("snuffleupagus")) die "skip"; ?> | ||
| 5 | --INI-- | ||
| 6 | sp.configuration_file={PWD}/config/config_crypt_session.ini | ||
| 7 | session.save_path = "/tmp" | ||
| 8 | --ENV-- | ||
| 9 | return <<<EOF | ||
| 10 | REMOTE_ADDR=127.0.0.1 | ||
| 11 | EOF; | ||
| 12 | --FILE-- | ||
| 13 | <?php | ||
| 14 | session_set_save_handler(new SessionHandler(), true); | ||
| 15 | session_start(); | ||
| 16 | $_SESSION['a'] = 'b'; | ||
| 17 | #var_dump($_SESSION); | ||
| 18 | session_destroy(); | ||
| 19 | session_set_save_handler(new SessionHandler(), true); | ||
| 20 | session_start(); | ||
| 21 | $_SESSION['a'] = 'b'; | ||
| 22 | var_dump($_SESSION); | ||
| 23 | session_destroy(); | ||
| 24 | ?> | ||
| 25 | --EXPECTF-- | ||
| 26 | Warning: SessionHandler::open(): Cannot call session save handler in a recursive manner in%s/tests/set_custom_session_handler2.php on line 8 | ||
| 27 | |||
| 28 | Warning: SessionHandler::close(): Cannot call session save handler in a recursive manner in %stests/set_custom_session_handler2.php on line 8 | ||
| 29 | |||
| 30 | Warning: session_start(): Failed to initialize storage module: user (path: %s) in %stests/set_custom_session_handler2.php on line 8 | ||
| 31 | array(1) { | ||
| 32 | ["a"]=> | ||
| 33 | string(1) "b" | ||
| 34 | } | ||
| 35 | |||
| 36 | Warning: session_destroy(): Trying to destroy uninitialized session in %s/tests/set_custom_session_handler2.php on line %d | ||
