ID: 28647 Updated by: [EMAIL PROTECTED] Reported By: bill dot stevens at hotmail dot com -Status: Open +Status: Bogus Bug Type: Session related Operating System: WindowsXP/Debian PHP Version: 4.3.7 New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Thank you for your interest in PHP. . Previous Comments: ------------------------------------------------------------------------ [2004-06-06 14:50:32] hellno at home dot org from php-doc: > -------- > Caution: > -------- > If you are using $_SESSION (or $HTTP_SESSION_VARS), > do not use session_register(), session_is_registered(), > and session_unregister(). so your files become: <?php session_start(); $normal=12; $_SESSION['normal'] = $normal; header('Location: datei2.php'); ?> <?php session_start(); echo "Normal:". $_SESSION["normal"] ."<br><br>\n"; ?> ------------------------------------------------------------------------ [2004-06-06 11:27:52] wm at tolkienforum dot de greetings this must be somehow script related. following code works on both windows/debian: datei1.php: ----------- <?php session_start(); $normal=1; session_register("normal"); $_SESSION['normal'] = 10; header('Location: datei2.php'); ?> datei2.php: ----------- <?php session_start(); session_register("normal"); echo "Normal:". $_SESSION["normal"] ."<br><br>\n"; // prints "Normal:10" ?> a bit weird your script works on win and does not on debian. since all the superglobals where introduced the session-coding changed. the docs include a lot of information (a lot of notice and caution stuff :p) good luck :) ------------------------------------------------------------------------ [2004-06-06 01:15:04] bill dot stevens at hotmail dot com Description: ------------ using sessions on windows xp/php 4.3.7 and register_globals off does work fine (code below). same script on debian-woody/php 4.3.1 and register_globals off does not read the session data. only register_globals on solves this (same code). session-related config on both machines is the same or changes had no effect. any ideas on config/scripting/stuff welcome :) Reproduce code: --------------- if( $this->useSessions ) { session_start(); // check, whether register globals is enabled if( ini_get( "register_globals" ) ) { session_register( $this->sessionVar ); if( !isset( $GLOBALS[$this->sessionVar] ) ) $GLOBALS[$this->sessionVar] = array(); $this->sessionData = &$GLOBALS[$this->sessionVar]; } // register globals is off, session_register is useless :-( else { if( isset( $_SESSION ) ) { if( !isset( $_SESSION[$this->sessionVar] ) ) $_SESSION[$this->sessionVar] = array(); $this->sessionData = &$_SESSION[$this->sessionVar]; } else { if( !isset( $GLOBALS["HTTP_SESSION_VARS"][$this->sessionVar] ) ) $GLOBALS["HTTP_SESSION_VARS"][$this->sessionVar] = array(); $this->sessionData = &$GLOBALS["HTTP_SESSION_VARS"][$this->sessionVar]; } } } Expected result: ---------------- register session vars. works on windows, does not on debian. Actual result: -------------- no session on debian. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28647&edit=1