ID:               28647
 Comment by:       wm at tolkienforum dot de
 Reported By:      bill dot stevens at hotmail dot com
 Status:           Open
 Bug Type:         Session related
 Operating System: WindowsXP/Debian
 PHP Version:      4.3.7
 New Comment:

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 :)


Previous Comments:
------------------------------------------------------------------------

[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

Reply via email to