You need a session_start() on your second page. ---John Holmes...
> -----Original Message----- > From: Adam Royle [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, October 08, 2002 10:06 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Transfer to another server - my sessions don't work! > > Hi, > > I transferred a small php site from my localhost to a new server > (commercial server). However, after I transferred it over, my sessions > would no longer work. Just as a test - here is some code I tried. > Please tell me I'm doing it the wrong way. Also, at the bottom of this > email this info from phpinfo(); if that helps. If I echo > $GLOBALS['PHPSESSID'] it looks like a regular session id. I can get the > info on the first page after I have chucked it into the session, but it > doesn't seem to get it when I go to the next page. > > Thanks. > Adam > > ----------- page1.php ----------- > <?php > > session_start(); > > $_SESSION['adam'] = "something secret here"; > > ?> > <a href="page2.php">Page 2</a> > ---------------------------------------- > > ----------- page2.php ----------- > <?php > > echo $_SESSION['adam']; // this don't do anything > > echo "Thats all."; // this prints fine > > echo $PHPSESSID; // this prints fine > > ?> > ---------------------------------------- > > > > Configure Command './configure' '--with-mysql' > '--with-apache=../apache_1.3.26' '--enable-track-vars' '--with-xml' > '--enable-memory-limit=yes' '--enable-bcmath' '--with-gd=../gd-2.0.1' > '--enable-gd-native-tt' '--enable-gd-imgstrttf' > '--with-gdbm=/usr/include' '--enable-calendar' > '--with-png-dir=/usr/lib' '--with-zlib-dir=/usr/include' > '--with-freetype-dir=/usr/local/include/freetype2' > '--with-jpeg-dir=/usr/local/lib' '--with-mcrypt' '--enable-trans-sid' > '--with-sablot=/usr/local/lib' '--with-imap' '--enable-xslt' > '--with-xslt-sablot' '--with-gettext' '--enable-sockets' '--enable-ftp' > '--enable-sablot-errors-descriptive' > > session > Session Support enabled > Directive Local Value Master Value > session.auto_start Off Off > session.cache_expire 180 180 > session.cache_limiter nocache nocache > session.cookie_domain no value no value > session.cookie_lifetime 0 0 > session.cookie_path / / > session.cookie_secure Off Off > session.entropy_file no value no value > session.entropy_length 0 0 > session.gc_maxlifetime 1440 1440 > session.gc_probability 1 1 > session.name PHPSESSID PHPSESSID > session.referer_check no value no value > session.save_handler files files > session.save_path /tmp /tmp > session.serialize_handler php php > session.use_cookies On On > session.use_trans_sid 1 1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php