Bug #18404 Updated: Session data being lost

From: Date: Thu, 18 Jul 2002 21:22:57 +0000
Subject: Bug #18404 Updated: Session data being lost
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-14564@lists.php.net to get a copy of this message
ID: 18404 Updated by: sniper@php.net Reported By: g.hort@unsw.edu.au -Status: Open +Status: Feedback Bug Type: Session related Operating System: redhat 7.2 PHP Version: 4.1.2 New Comment: Please try this snapshot: http://snaps.php.net/php4-latest.tar.gz Previous Comments: ------------------------------------------------------------------------ [2002-07-18 04:40:43] g.hort@unsw.edu.au 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 this bug report at http://bugs.php.net/?id=18404&edit=1

« previous php.bugs (#14564) next »