sessions and reg_globals=off

From: Date: Thu, 03 May 2001 14:31:15 +0000
Subject: sessions and reg_globals=off
Groups: php.general 
Request: Send a blank email to php-general+get-51270@lists.php.net to get a copy of this message
Hello, I'm having a problem getting sessions to work with register_globals=off. The following 2 files work fine if reg_globals=on but not when off. When I look at the session file it reads like this: !varA|!varB| and not like it should: varA|s:4:"funk";varB|s:4:"that"; //-----------------------------sess01.php <?php session_start(); session_register('varA'); session_register('varB'); ?> <form action="sess02.php"> first name:<input type="text" name="varA"> <br> last name:<input type="text" name="varB"> <input type="submit" value="send"> </form> //----------------------------sess02.php <?php session_start(); print("$varA $varB"); ?> What do I have to do to make this work with register_globals off? Thank you very much for help. (If I get some time/answers I think I'm gonna design a page that shows sample scripts that work with reg_globals=on and their equivalents with reg_globals=off; this might be beneficial for some newbies--such as myself. If anybody would like to contribute, please email me and you'll be duly credited if such a project comes to fruition. Thanx!) --ahmad.

« previous php.general (#51270) next »