#17069 [Opn->Csd]: Session & register_globals

From: Date: Fri, 04 Oct 2002 03:41:11 +0000
Subject: #17069 [Opn->Csd]: Session & register_globals
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969348966@lists.php.net to get a copy of this message
ID: 17069 Updated by: iliaa@php.net Reported By: drnix@aha.ru -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: Windows 2000 PHP Version: 4.1.2 New Comment: This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2002-08-23 08:04:52] mfischer@php.net I'm wondering if this is actually still true. Can anyone confirm this? ------------------------------------------------------------------------ [2002-05-30 06:46:21] mfischer@php.net It's a mis-assumption that session_register()ing a global variable put's it into $_SESSION in the same request. Sessions never behaved this way. The documentation should be clearer on this, reclassifying. ------------------------------------------------------------------------ [2002-05-07 05:57:46] drnix@aha.ru This code don't work properly: ---- <?php session_start(); if (get_cfg_var('register_globals')) { if (!session_is_registered('step')) { session_register("step"); $step = 0; } } else { if (!isset($_SESSION['step'])) { $_SESSION['step'] = 0; } } echo $_SESSION['step']++; echo session_encode(); ?> <br><A HREF="<?php echo $_SERVER['PHP_SELF']?>">Reload</A> ---- If register_globals is On, reload will increment counter. If register_globals is Off, session will "read_only" like. It create session file with zero length. Any write not occurs. session_encode() returns a empty string; ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=17069&edit=1

« previous php.doc (#969348966) next »