Re: Using sessions with register globals off

From: Date: Thu, 05 Feb 2004 09:12:04 +0000
Subject: Re: Using sessions with register globals off
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-176873@lists.php.net to get a copy of this message
PHP Manual: If register_globals is enabled, then each global variable can be registered as session variable. Upon a restart of a session, these variables will be restored to corresponding global variables. Since PHP must know which global variables are registered as session variables, users need to register variables with session_register() function. You can avoid this by simply setting entries in $_SESSION. just set the superglobal to the desired value. to remove when you're through you can use session_unregister('foo') or unset($_SESSION['foo']). do not unset $_SESSION itself!!! $_SESSION['foo'] = "bar"; ~pj > I've looked through the docs and past posts but I'm still a bit confused. > How do I translate the following into code that can be used with > register_globals set off. > > Assuming there's a preceding page that has created the session 'name' and > registered the var 'order' with the 'name' session. > > > session_name('name'); > session_register('order'); > > > -- > Randall Perry > sysTame > > Xserve Web Hosting/Co-location > Website Development/Promotion > Mac Consulting/Sales > > http://www.systame.com/

« previous php.general (#176873) next »