Bug #18404: Session data being lost

From: Date: Thu, 18 Jul 2002 08:40:45 +0000
Subject: Bug #18404: Session data being lost
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-14503@lists.php.net to get a copy of this message
From: g.hort@unsw.edu.au Operating system: redhat 7.2 PHP version: 4.1.2 PHP Bug Type: Session related Bug description: Session data being lost If you go to ftest.html (see below) and upload a file of reasonably large size (80k) then click view to go to ftest.php (see below) the variable $_SESSION['fdata'] is undefined and you get the message "data lost" if using mysql to store sessions. If using files to store sessions or the uploaded file is small it works. This happens on redhat 7.2 with apache 1.3.22, mysql 3.23.41 & php-4.1.2-0horde1 & php-mysql-4.1.20-horde1 from the horde web site (www.horde.org). I used the php.ini & httpd.conf that gets installed as standard except for the config below. I've also seen this happen on Solaris 8, apache 1.3.26, php-4.2.1 and both mysql and sybase-ct. It shows up when importing csv address book files into IMP/turba. Unfortunately it's intermittent on linux :-( my session handler is http://sporty.nun.unsw.edu.au/pear_session2.phps apache config: <Directory "/var/www/html/ftest"> Options Indexes FollowSymLinks AllowOverride All order allow,deny allow from all php_flag register_globals Off php_value session.save_handler user php_value session.auto_start 0 php_value session.use_cookies 1 php_value session.use_trans_sid 0 php_value session.gc_maxlifetime 2200 php_value session.cache_limiter nocache php_value session.save_path mysql://horde:horde@localhost/test php_value auto_prepend_file /usr/share/php/pear_session2.php </Directory> ftest.html: <html> <head><title>Session Test Initial</title></head> <body> <form enctype="multipart/form-data" action="ftest.php" method="post"> <input type="hidden" name="MAX_FILE_SIZE" value="5000000"> Send this file: <input name="userfile" type="file"> <input type="submit" value="Send File"> </form> </body> </html> ftest.php: <?php session_start(); echo "<html>\nsession ID is ".session_id()."<br />\n"; if (isset($_FILES['userfile'])) { echo "file name is ".$_FILES['userfile']['name']."<br />\n"; echo "file name is ".$_FILES['userfile']['tmp_name']."<br />\n"; echo "file type is ".$_FILES['userfile']['type']."<br />\n"; echo "file size is ".$_FILES['userfile']['size']."<br />\n"; $importData = file($_FILES['userfile']['tmp_name']); $_SESSION['md5'] = md5(serialize($importData)); $_SESSION['fdata'] = $importData; echo "md5 is ".$_SESSION['md5']."<br />\n"; echo "<a href=\"".$_SERVER['PHP_SELF']."\">View</a><br />\n"; } else { if (isset($_SESSION['fdata'])) { echo "session md5 is ".$_SESSION['md5']."<br />\n"; echo "saved file md5 is ".md5(serialize($_SESSION['fdata']))."<br />\n"; } else { echo "data lost<br />\n"; } echo "<a href=\"ftest.html\">Another</a><br />\n"; } ?> </html> -- Edit bug report at http://bugs.php.net/?id=18404&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=18404&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=18404&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=18404&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=18404&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=18404&r=support Expected behavior: http://bugs.php.net/fix.php?id=18404&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=18404&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=18404&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=18404&r=globals

« previous php.bugs (#14503) next »