summaryrefslogtreecommitdiff
path: root/src/tests/session_encryption/crypt_session_valid_simul.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/session_encryption/crypt_session_valid_simul.phpt')
-rw-r--r--src/tests/session_encryption/crypt_session_valid_simul.phpt27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/tests/session_encryption/crypt_session_valid_simul.phpt b/src/tests/session_encryption/crypt_session_valid_simul.phpt
new file mode 100644
index 0000000..28083cf
--- /dev/null
+++ b/src/tests/session_encryption/crypt_session_valid_simul.phpt
@@ -0,0 +1,27 @@
1--TEST--
2SESSION crypt/decrypt valid
3--SKIPIF--
4<?php if (!extension_loaded("snuffleupagus")) die "skip"; ?>
5--INI--
6sp.configuration_file={PWD}/config/config_crypt_session_simul.ini
7--ENV--
8return <<<EOF
9REMOTE_ADDR=127.0.0.1
10EOF;
11--FILE--
12<?php
13// Do it like that to write (encrypt) the session and then to read (decrypt) the session
14session_start(); // Start new_session , it will read an empty session
15$_SESSION["toto"] = "tata"; // Encrypt and write the session
16$id = session_id(); // Get the session_id to use it later
17session_write_close(); // Close the session
18
19session_id($id); // Recover the session with the previous session_id
20session_start(); // Re start the session, It will read and decrypt the non empty session
21var_dump($_SESSION); // Dump the session
22?>
23--EXPECTF--
24array(1) {
25 ["toto"]=>
26 string(4) "tata"
27}