Re: problems with sessions (not working)

From: Date: Sun, 28 Oct 2001 06:03:35 +0000
Subject: Re: problems with sessions (not working)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-72608@lists.php.net to get a copy of this message
Christian Dechery wrote:
I have a file called miec.php that does quite a lot of processing and then include()s user_track.inc.php...
Where did you register the session variable? If you are registering local variable as session variable, it may not work... I suggest to use $HTTP_SESSION_VARS, if it is possible... -- Yasuo Ohgaki
miec.php: -------- <?
    a lot of db processing .... (NO OUTPUT whatsoever)
    include("user_track.inc.php");
    UserTrack($products);
    the output starts here...
?> user_track.inc.php: ------------------ <?
    session_start();
    function UserTrack($products)
    {
        global $prod_views;
               if( !session_is_registered("prod_views") )
        {
            fill the $prod_views array, serialize it...
            session_register("prod_views");
            // I've tested the code above... and session_register returns TRUE and I saw the session file...
        }
        else
        {
            do other stuff with the prod_views array
        }
    }
?> the problem is.... why does it NEVER go into the 'else'... it seems that the session is registered... but as soon as I refresh the page the session is lost... why?
               
_____________________________ . Christian Dechery . . Gaita-L Owner / Web Developer . . http://www.webstyle.com.br . . http://www.tanamesa.com.br


« previous php.general (#72608) next »