Forums
This topic is locked
Session Variable Hell
Posted 14 Apr 2003 23:47:48
1
has voted
14 Apr 2003 23:47:48 Robert Kruse posted:
I didn't expect so much trouble with setting Session Variables in PHP. As of now I still can't get them to pass from page to page holding any kind of value. Here's the code I've been using...session_start();
$TestSessionVar = "Hello";
session_register("TestSessionVar"
then on the next page I use this to call the session...
echo $HTTP_SESSION_VARS['TestSessionVar'];
I've looked in my PHP.ini and found the session.save_path = C:\PHP\sessiondata, which exists and I found a file that records the session variable data.
Is there anything I'm doing wrong? Is my code at least correct for setting and retrieving Session Variables?
Thanks.
Replies
Replied 16 Apr 2003 23:29:34
16 Apr 2003 23:29:34 Michael O'Neill replied:
Looks fine to me, I think!!!!!!
I hate to state the obvious, but have you started the session on the receiving page?
session_start();
I hate to state the obvious, but have you started the session on the receiving page?
session_start();
Replied 07 May 2003 09:52:37
07 May 2003 09:52:37 Plamen Jelezov replied:
Hi!
If you have so much troubles with setting up the session variables, just set the 'session.auto_start =0' to 'session.auto_start =1' in your php.ini file. It should be at line 716. Doing so will give you the freedom not to buz around with how to set up the session, but to actually write down functional code. "carphone" is right. You can also check whether you have included 'session_start();' at the begining of each file you will need sessions to work with.
brgds.
pj.
If you have so much troubles with setting up the session variables, just set the 'session.auto_start =0' to 'session.auto_start =1' in your php.ini file. It should be at line 716. Doing so will give you the freedom not to buz around with how to set up the session, but to actually write down functional code. "carphone" is right. You can also check whether you have included 'session_start();' at the begining of each file you will need sessions to work with.
brgds.
pj.