Thread: [Phplib-users] session variable
Brought to you by:
nhruby,
richardarcher
From: Norbert F. <fe...@hu...> - 2004-05-05 08:20:07
|
Hello, My program lose session variable. I register a variable with $sess->register and it works fine. I can read its value with $_SESSION, and even the $sess->is_registered returns with true. I can read the value of this session variable just before page_close and after page_close. There is nothing else after page_close, I only print this value. If I refresh the page, my session variable is not set. I tried to print out its value just after session_start is called in function $sess->start in session4.inc but nothing. Register_globals is off in php.ini. I use the following versions: win xp apache: 2.0.49 php: 4.3.6 phplib 7.4 I have no idea what should I do to find the problem. I hope you could understend my problem and my english. Thanks, Norbert |
From: patrick <pm...@sa...> - 2004-05-05 14:09:10
|
Make sure you do page_close at the end of your page Norbert Felde wrote: > Hello, > > My program lose session variable. > > I register a variable with $sess->register and it works fine. > I can read its value with $_SESSION, and even the $sess->is_registered > returns with true. > I can read the value of this session variable just before page_close and > after page_close. There is nothing else after page_close, I only print > this value. > > If I refresh the page, my session variable is not set. I tried to print > out its value just after session_start is called in function > $sess->start in session4.inc but nothing. > > Register_globals is off in php.ini. > I use the following versions: > win xp > apache: 2.0.49 > php: 4.3.6 > phplib 7.4 > > > I have no idea what should I do to find the problem. > > I hope you could understend my problem and my english. > > Thanks, > Norbert > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users > |
From: <fmo...@fm...> - 2004-05-05 17:26:58
|
The exact syntax is: <?php page_close() ?> assuming you're in an html context up to that point. Forgetting to put this in has bitten me in the butt before. Another source of the same problem would be a routine or condition in your PHP code which would cause an exit() from the page without execution reaching the page_close() call at the bottom of the page. If you have any program flow control in your code which would bypass this call, you'll need to make sure that page_close() is called somewhere else. Thus spake patrick on Wed, May 05, 2004 at 09:09:01AM CDT > Make sure you do > page_close > at the end of your page > > Norbert Felde wrote: > > Hello, > > > > My program lose session variable. > > > > I register a variable with $sess->register and it works fine. > > I can read its value with $_SESSION, and even the $sess->is_registered > > returns with true. > > I can read the value of this session variable just before page_close and > > after page_close. There is nothing else after page_close, I only print > > this value. > > > > If I refresh the page, my session variable is not set. I tried to print > > out its value just after session_start is called in function > > $sess->start in session4.inc but nothing. > > > > Register_globals is off in php.ini. > > I use the following versions: > > win xp > > apache: 2.0.49 > > php: 4.3.6 > > phplib 7.4 > > > > > > I have no idea what should I do to find the problem. > > > > I hope you could understend my problem and my english. > > > > Thanks, > > Norbert > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by: Oracle 10g > > Get certified on the hottest thing ever to hit the market... Oracle 10g. > > Take an Oracle 10g class now, and we'll give you the exam FREE. > > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click > > _______________________________________________ > > Phplib-users mailing list > > Php...@li... > > https://lists.sourceforge.net/lists/listinfo/phplib-users > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users -- Lindsay Haisley | "Everything works | PGP public key FMP Computer Services | if you let it" | available at 512-259-1190 | (The Roadie) | <http://www.fmp.com/pubkeys> http://www.fmp.com | | |
From: Clark F. <cl...@th...> - 2004-05-05 15:54:19
|
Norbert, It sounds like you are doing a page_close(), so I'm guessing that's not the problem. Also, I'm not positive but I believe page_close() is not even necessary when using PHP4 native sessions, because PHP will automatically write the session at the end of output. Can you send along a code snippet (all the way from page_open to page_close) illustrating how you want to use your session variable and how it's not working? Also, make sure you are including local4.inc and session4.inc in your prepend.php, and using local4.inc to define your derived session class. Are you using sessions only, or are you using auth, perm or user as well? Are you using cookie or get mode for the session? If you are using cookies, you might check your browser files to see if the cookie is being set. Best, Clark On Wed, 5 May 2004, Norbert Felde wrote: > Hello, > > My program lose session variable. > > I register a variable with $sess->register and it works fine. > I can read its value with $_SESSION, and even the $sess->is_registered > returns with true. > I can read the value of this session variable just before page_close and > after page_close. There is nothing else after page_close, I only print > this value. > > If I refresh the page, my session variable is not set. I tried to print > out its value just after session_start is called in function > $sess->start in session4.inc but nothing. > > Register_globals is off in php.ini. > I use the following versions: > win xp > apache: > 2.0.49 > php: > 4.3.6 > phplib > 7.4 > > > I have no idea what should I do to find the problem. > > I hope you could understend my problem and my english. > > Thanks, > Norbert |