#24380 [Fbk->Opn]: session side-effect bug

From: Date: Sun, 29 Jun 2003 02:12:20 +0000
Subject: #24380 [Fbk->Opn]: session side-effect bug
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-42704@lists.php.net to get a copy of this message
ID: 24380 User updated by: akukin at ihug dot co dot nz Reported By: akukin at ihug dot co dot nz -Status: Feedback +Status: Open Bug Type: Session related Operating System: win2k & linux PHP Version: 4.3.2 New Comment: I have dumped all PHP core options for your info. register_globals is OFF. All PHP Core options: Directive Local Value Master Value allow_call_time_pass_reference On On allow_url_fopen On On always_populate_raw_post_data Off Off arg_separator.input & & arg_separator.output & & asp_tags Off Off auto_append_file no value no value auto_prepend_file no value no value browscap no value no value default_charset no value no value default_mimetype text/html text/html define_syslog_variables Off Off disable_classes no value no value disable_functions no value no value display_errors On On display_startup_errors Off Off doc_root no value no value docref_ext no value no value docref_root no value no value enable_dl On On error_append_string no value no value error_log no value no value error_prepend_string no value no value error_reporting 2047 2047 expose_php On On extension_dir ./ ./ file_uploads On On gpc_order GPC GPC html_errors On On ignore_repeated_errors Off Off ignore_repeated_source Off Off ignore_user_abort Off Off implicit_flush Off Off log_errors Off Off log_errors_max_len 1024 1024 magic_quotes_gpc On On magic_quotes_runtime Off Off magic_quotes_sybase Off Off max_execution_time 30 30 max_input_time 60 60 open_basedir no value no value output_buffering no value no value output_handler no value no value post_max_size 8M 8M precision 12 12 register_argc_argv On On register_globals Off Off report_memleaks On On safe_mode Off Off safe_mode_exec_dir no value no value safe_mode_gid Off Off safe_mode_include_dir no value no value sendmail_from akukin@ihug.co.nz akukin@ihug.co.nz sendmail_path no value no value serialize_precision 100 100 short_open_tag On On SMTP smtp.ihug.co.nz smtp.ihug.co.nz smtp_port 25 25 sql.safe_mode Off Off track_errors Off Off unserialize_callback_func no value no value upload_max_filesize 2M 2M upload_tmp_dir C:\PHP\uploadtemp C:\PHP\uploadtemp user_dir no value no value variables_order EGPCS EGPCS xmlrpc_error_number 0 0 xmlrpc_errors Off Off y2k_compliance On On Previous Comments: ------------------------------------------------------------------------ [2003-06-28 20:54:32] sniper@php.net Is register_globals on or off? Try this: <?php echo ini_get('register_globals'); ?> ------------------------------------------------------------------------ [2003-06-28 18:39:40] akukin at ihug dot co dot nz Description: ------------ 1. After running the following source code I get: ================================================ Warning: Unknown(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0 ================================================ I expect no such warning as I am not using any register_globals etc I am only using the suggested session handling API: session_start & $_SESSION array. 2. Also found: By changing the last 2 lines to: //$_SESSION["test"] = NULL; unset($_SESSION["test"]); warning disappears. By changing "$test = " to "$test2 = " warning disappears either. Shall it be the feature I would appreciate if you send me an explanation of this feature as it does not make any sense to me. Reproduce code: --------------- <? session_start(); $test = isset($_SESSION["test"]) ? $_SESSION["test"] : "test"; $_SESSION["test"] = NULL; //unset($_SESSION["test"]); ?> Expected result: ---------------- I expect not to have this warning as I am not using any register_globals etc I am only using the suggested session handling API: session_start & $_SESSION array. Actual result: -------------- Warning: Unknown(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=24380&edit=1

« previous php.bugs (#42704) next »