Session hell: register_globals off
| From: | Randall Perry | Date: | Fri, 02 Apr 2004 22:29:14 +0000 |
| Subject: | Session hell: register_globals off | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-182207@lists.php.net to get a copy of this message | ||
Had a previous thread on this issue. Started working on it again and am
running into new bugs, so thought I'd start a new thread.
Read thoroughly through session examples in docs and here's how I tried to
pass an object from one page to another:
page 1
______
// include class definition file
include_once "order_classes.php";
// start session
session_start();
// create instance of class Order
$order = New Order();
// assign class instance to $SESSION[]
$_SESSION['order'] = $order;
page 2
______
// include class definition file
include_once "order_classes.php";
// start session
session_start();
// assign $_SESSION['order'] object to variable
$order = $_SESSION['order'];
I'm getting the following error when page 2 loads:
[error] PHP Notice: Undefined variable: _SESSION
Any ideas?
Pertinent PHP vars:
___________________
Darwin systame.cniweb.net 7.2.0 Darwin Kernel Version 7.2.0: Thu Dec 11
16:20:23 PST 2003; root:xnu/xnu-517.3.7.obj~1/RELEASE_PPC Power Macintosh
Build Date Apr 2 2004 12:58:17
Configure Command './configure' '--with-apxs=/usr/sbin/apxs'
'--with-pgsql'
'--with-xml' '--with-openssl=/usr/local/ssl' '--with-pear'
'--with-curl=/usr/lib'
Apache/1.3.29 (Darwin) DAV/1.0.3 mod_perl/1.29 PHP/4.3.5 mod_jk/1.2.4
mod_ssl/2.8.16 OpenSSL/0.9.7c
register_globals Off Off
--
Randall Perry
sysTame
Xserve Web Hosting/Co-location
Website Development/Promotion
Mac Consulting/Sales
http://www.systame.com/