Re: sessions trouble

From: Date: Tue, 18 Jun 2002 19:02:13 +0000
Subject: Re: sessions trouble
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-102757@lists.php.net to get a copy of this message
Ok, tried that. No difference. At 12:49 PM 6/18/2002, you wrote:
Try using the fuction session_write_close() after your done setting the session vars. dunno but it might work :) Rick ----- Original Message ----- From: "Leston Drake" <ldrake@lpsoftware.com> To: "Johnson, Kirk" <kjohnson@zootweb.com> Cc: <php-general@lists.php.net> Sent: Tuesday, June 18, 2002 1:28 PM Subject: RE: [PHP] sessions trouble I have register_globals=Off (which is what I prefer to program for). But if I change register_globals to On, and use the session_register() function, it works. With register_globals Off, using $_SESSION doesn't work. I thought that $_SESSION would work regardless of whether register_globals was On or Off. At 12:19 PM 6/18/2002, you wrote:
Check the register_globals setting in php.ini. It looks like it is "on"
on
the problem server. If so, then you have two choices: 1. Turn it "off" 2. Change your code to this style: session_start(); $node = 10.2; session_register('node'); echo $node; Kirk
-----Original Message----- From: Leston Drake [mailto:ldrake@lpsoftware.com] Sent: Tuesday, June 18, 2002 11:48 AM To: php-general@lists.php.net Subject: [PHP] sessions trouble Hello, I am unable to retrieve session variables on my local server. I'm using some code like this to test it (thanks to Ed): ------------------------------------------------------------------ session_start(); echo ":" . $_SESSION["node"] . "<br>"; $_SESSION["node"] = "10.2"; echo ":" . $_SESSION["node"] . "<br>"; ------------------------------------------------------------------ Then there is an href link to the same document, to test whether or not it can see $_SESSION["node"] the next time. It can't. The output for both requests looks like this: ------------------------------------------------------------------ Warning: Undefined index: node in c:\program files\apache group\apache\htdocs\test5.php on line 3 : :10.2 test ------------------------------------------------------------------ On another server
(http://www.lpsoftware.com/phptest/test5.php) it works as expected. But I can't figure out why it doesn't work here. I'm running WinME, Apache 1.3.2, Php 4.1.2 I have cookies enabled (actually prompted so I can 'see' it) for my
browser.
Is there some setting in php.ini that I need to change? BTW, being a php newbie I really appreciate the helpful people on this list! You're a great resource. TIA, Leston -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.general (#102757) next »