diff options
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/session/mod_files.c | 4 | ||||
| -rw-r--r-- | ext/session/mod_mm.c | 4 | ||||
| -rw-r--r-- | ext/session/tests/bug65475.phpt | 34 | ||||
| -rw-r--r-- | ext/session/tests/rfc1867.phpt | 1 | ||||
| -rw-r--r-- | ext/session/tests/rfc1867_cleanup.phpt | 1 | ||||
| -rw-r--r-- | ext/session/tests/rfc1867_disabled.phpt | 1 | ||||
| -rw-r--r-- | ext/session/tests/rfc1867_disabled_2.phpt | 1 | ||||
| -rw-r--r-- | ext/session/tests/rfc1867_inter.phpt | 1 | ||||
| -rw-r--r-- | ext/session/tests/rfc1867_no_name.phpt | 1 | ||||
| -rw-r--r-- | ext/session/tests/rfc1867_sid_cookie.phpt | 1 | ||||
| -rw-r--r-- | ext/session/tests/rfc1867_sid_get.phpt | 1 | ||||
| -rw-r--r-- | ext/session/tests/rfc1867_sid_get_2.phpt | 1 | ||||
| -rw-r--r-- | ext/session/tests/rfc1867_sid_only_cookie.phpt | 1 | ||||
| -rw-r--r-- | ext/session/tests/rfc1867_sid_post.phpt | 1 | ||||
| -rw-r--r-- | ext/session/tests/session_id_basic.phpt | 2 |
15 files changed, 51 insertions, 4 deletions
diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c index e5733b44f4..004d9d4637 100644 --- a/ext/session/mod_files.c +++ b/ext/session/mod_files.c @@ -338,13 +338,13 @@ PS_READ_FUNC(files) if (!PS(id)) { return FAILURE; } - php_session_reset_id(TSRMLS_C); if (PS(use_cookies)) { PS(send_cookie) = 1; } + php_session_reset_id(TSRMLS_C); } - ps_files_open(data, key TSRMLS_CC); + ps_files_open(data, PS(id) TSRMLS_CC); if (data->fd < 0) { return FAILURE; } diff --git a/ext/session/mod_mm.c b/ext/session/mod_mm.c index 69c0da7bdb..3d37b981bc 100644 --- a/ext/session/mod_mm.c +++ b/ext/session/mod_mm.c @@ -367,13 +367,13 @@ PS_READ_FUNC(mm) if (!PS(id)) { return FAILURE; } - php_session_reset_id(TSRMLS_C); if (PS(use_cookies)) { PS(send_cookie) = 1; } + php_session_reset_id(TSRMLS_C); } - sd = ps_sd_lookup(data, key, 0); + sd = ps_sd_lookup(data, PS(id), 0); if (sd) { *vallen = sd->datalen; *val = emalloc(sd->datalen + 1); diff --git a/ext/session/tests/bug65475.phpt b/ext/session/tests/bug65475.phpt new file mode 100644 index 0000000000..7dc5463879 --- /dev/null +++ b/ext/session/tests/bug65475.phpt @@ -0,0 +1,34 @@ +--TEST-- +Bug #65475: Session ID is not initialized when session.usr_strict_mode=1 +--INI-- +session.save_handler=files +session.name=PHPSESSID +--SKIPIF-- +<?php include('skipif.inc'); ?> +--FILE-- +<?php +ob_start(); + +echo "Testing file module".PHP_EOL; +session_start(); +$_SESSION['foo'] = 1234; +$_SESSION['cnt'] = 1; +$session_id = session_id(); +session_write_close(); + +session_start(); +var_dump($session_id === session_id()); +$_SESSION['cnt']++; +session_write_close(); + +session_start(); +var_dump($session_id === session_id()); +var_dump($_SESSION['cnt']); // Should be int(2) +session_write_close(); + +--EXPECTF-- +Testing file module +bool(true) +bool(true) +int(2) + diff --git a/ext/session/tests/rfc1867.phpt b/ext/session/tests/rfc1867.phpt index dc44e8b443..6b14bcb4ef 100644 --- a/ext/session/tests/rfc1867.phpt +++ b/ext/session/tests/rfc1867.phpt @@ -7,6 +7,7 @@ comment=debug builds show some additional E_NOTICE errors upload_max_filesize=1024 session.save_path= session.name=PHPSESSID +session.use_strict_mode=0 session.use_cookies=1 session.use_only_cookies=0 session.upload_progress.enabled=1 diff --git a/ext/session/tests/rfc1867_cleanup.phpt b/ext/session/tests/rfc1867_cleanup.phpt index f70b395d22..f84385bada 100644 --- a/ext/session/tests/rfc1867_cleanup.phpt +++ b/ext/session/tests/rfc1867_cleanup.phpt @@ -7,6 +7,7 @@ comment=debug builds show some additional E_NOTICE errors upload_max_filesize=1024 session.save_path= session.name=PHPSESSID +session.use_strict_mode=0 session.use_cookies=1 session.use_only_cookies=0 session.upload_progress.enabled=1 diff --git a/ext/session/tests/rfc1867_disabled.phpt b/ext/session/tests/rfc1867_disabled.phpt index 4490055791..550ee3a7a2 100644 --- a/ext/session/tests/rfc1867_disabled.phpt +++ b/ext/session/tests/rfc1867_disabled.phpt @@ -7,6 +7,7 @@ comment=debug builds show some additional E_NOTICE errors upload_max_filesize=1024 session.save_path= session.name=PHPSESSID +session.use_strict_mode=0 session.use_cookies=1 session.use_only_cookies=0 session.upload_progress.enabled=0 diff --git a/ext/session/tests/rfc1867_disabled_2.phpt b/ext/session/tests/rfc1867_disabled_2.phpt index e878f4619f..83e97eeed1 100644 --- a/ext/session/tests/rfc1867_disabled_2.phpt +++ b/ext/session/tests/rfc1867_disabled_2.phpt @@ -7,6 +7,7 @@ comment=debug builds show some additional E_NOTICE errors upload_max_filesize=1024 session.save_path= session.name=PHPSESSID +session.use_strict_mode=0 session.use_cookies=1 session.use_only_cookies=0 session.upload_progress.enabled=1 diff --git a/ext/session/tests/rfc1867_inter.phpt b/ext/session/tests/rfc1867_inter.phpt index 768637105c..4d9b262230 100644 --- a/ext/session/tests/rfc1867_inter.phpt +++ b/ext/session/tests/rfc1867_inter.phpt @@ -7,6 +7,7 @@ comment=debug builds show some additional E_NOTICE errors upload_max_filesize=1024 session.save_path= session.name=PHPSESSID +session.use_strict_mode=0 session.use_cookies=1 session.use_only_cookies=0 session.upload_progress.enabled=1 diff --git a/ext/session/tests/rfc1867_no_name.phpt b/ext/session/tests/rfc1867_no_name.phpt index c1dda8156e..d68a61d929 100644 --- a/ext/session/tests/rfc1867_no_name.phpt +++ b/ext/session/tests/rfc1867_no_name.phpt @@ -7,6 +7,7 @@ comment=debug builds show some additional E_NOTICE errors upload_max_filesize=1024 session.save_path= session.name=PHPSESSID +session.use_strict_mode=0 session.use_cookies=1 session.use_only_cookies=0 session.upload_progress.enabled=1 diff --git a/ext/session/tests/rfc1867_sid_cookie.phpt b/ext/session/tests/rfc1867_sid_cookie.phpt index 735a5ac201..2864799335 100644 --- a/ext/session/tests/rfc1867_sid_cookie.phpt +++ b/ext/session/tests/rfc1867_sid_cookie.phpt @@ -7,6 +7,7 @@ comment=debug builds show some additional E_NOTICE errors upload_max_filesize=1024 session.save_path= session.name=PHPSESSID +session.use_strict_mode=0 session.use_cookies=1 session.use_only_cookies=0 session.upload_progress.enabled=1 diff --git a/ext/session/tests/rfc1867_sid_get.phpt b/ext/session/tests/rfc1867_sid_get.phpt index cc5a793e7b..e3a48a1c13 100644 --- a/ext/session/tests/rfc1867_sid_get.phpt +++ b/ext/session/tests/rfc1867_sid_get.phpt @@ -7,6 +7,7 @@ comment=debug builds show some additional E_NOTICE errors upload_max_filesize=1024 session.save_path= session.name=PHPSESSID +session.use_strict_mode=0 session.use_cookies=1 session.use_only_cookies=0 session.upload_progress.enabled=1 diff --git a/ext/session/tests/rfc1867_sid_get_2.phpt b/ext/session/tests/rfc1867_sid_get_2.phpt index 1d22e5930b..e21ca4ca2b 100644 --- a/ext/session/tests/rfc1867_sid_get_2.phpt +++ b/ext/session/tests/rfc1867_sid_get_2.phpt @@ -7,6 +7,7 @@ comment=debug builds show some additional E_NOTICE errors upload_max_filesize=1024 session.save_path= session.name=PHPSESSID +session.use_strict_mode=0 session.use_cookies=0 session.use_only_cookies=0 session.upload_progress.enabled=1 diff --git a/ext/session/tests/rfc1867_sid_only_cookie.phpt b/ext/session/tests/rfc1867_sid_only_cookie.phpt index 9a0105668f..41f6761fb9 100644 --- a/ext/session/tests/rfc1867_sid_only_cookie.phpt +++ b/ext/session/tests/rfc1867_sid_only_cookie.phpt @@ -7,6 +7,7 @@ comment=debug builds show some additional E_NOTICE errors upload_max_filesize=1024 session.save_path= session.name=PHPSESSID +session.use_strict_mode=0 session.use_cookies=1 session.use_only_cookies=1 session.upload_progress.enabled=1 diff --git a/ext/session/tests/rfc1867_sid_post.phpt b/ext/session/tests/rfc1867_sid_post.phpt index 7c1eb2de5d..107957f8db 100644 --- a/ext/session/tests/rfc1867_sid_post.phpt +++ b/ext/session/tests/rfc1867_sid_post.phpt @@ -7,6 +7,7 @@ comment=debug builds show some additional E_NOTICE errors upload_max_filesize=1024 session.save_path= session.name=PHPSESSID +session.use_strict_mode=0 session.use_cookies=1 session.use_only_cookies=0 session.upload_progress.enabled=1 diff --git a/ext/session/tests/session_id_basic.phpt b/ext/session/tests/session_id_basic.phpt index 5cb13c25ea..852d2f9578 100644 --- a/ext/session/tests/session_id_basic.phpt +++ b/ext/session/tests/session_id_basic.phpt @@ -20,6 +20,8 @@ var_dump(session_id("test")); var_dump(session_id()); var_dump(session_id("1234567890")); var_dump(session_id()); +// Turn off strice mode, since it does not allow uninitialized session ID +ini_set('session.use_strict_mode',false); var_dump(session_start()); var_dump(session_id()); var_dump(session_destroy()); |
