Probably i got the problem... but i don't know how to solve it!!!

i include one of my class.
in the constructor of this class i did a global...
global $_SESSION;

as soon as i delete that line. my script works perfect...

is this not allowed anymore... to access $_SESSION in a constructor??

regards, jazper





"Juerg Zgraggen" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> hi
>
> got a big session-problem and i have no idea what i'm doing wrong...
>
> i have quite a big web-app and i tried to upgrade the code.
> ex:     $frm_id     to    $_POST['frm_id']
> and    $HTTP_SESSION_VAR['myId']   to   $_SESSION['myId']
> ... ect...
>
> i changed the register_globals = Off in the php.ini and tried to browse my
> webapp.
>
> now my problem: i wrote in my navigation-frame this code:
> <?php
>    if( !isset($_SESSION['testint'] ) )
>    {
>        $_SESSION['testint'] = 1;
>    }
>     $_SESSION['testint']++;
>     print_r($_SESSION);
> ?>
>
> after the print_r() i can see my 'testint'-session-variable on the
> navigation-site. however on the other frame-site. i do NOT see this
> 'testint'-session-variable when i reload it. and when i reload the
> navigation-frame the variable does appear but does NOT increase. isset()
> always return false!!! when i take a look at the session-file on my
> Computer, i do NOT find the variable 'testint'...
>
> now when i make a complete new dummy php-file and copy-paste this
> session-code on the navigation-site then the session works perfectly. even
> when i call the navigation-site again AFTER processing this
dummy-php-file.
> the session for this variable works suddenly.
>
> what am i doing wrong???
> please give me a hint!
> regards, jazper

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to