Re: session-problem
| From: | Juerg Zgraggen | Date: | Mon, 01 Sep 2003 22:53:34 +0000 |
| Subject: | Re: session-problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-161396@lists.php.net to get a copy of this message | ||
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" <j.a.z@bluewin.ch> schrieb im Newsbeitrag
news:20030901223834.46551.qmail@pb1.pair.com...
> 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