#37834 [NEW]: Sesssion Handling Issue

From: Date: Sat, 17 Jun 2006 22:27:02 +0000
Subject: #37834 [NEW]: Sesssion Handling Issue
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-98441@lists.php.net to get a copy of this message
From: swcook at gmail dot com Operating system: Linux PHP version: 4.4.2 PHP Bug Type: Session related Bug description: Sesssion Handling Issue Description: ------------ I understand that PHP is server-side and this should really not happen, but I have a purely php page that cannot access the $_SESSION unless a user is using Internet Explorer. Moreover, Firefox and Opera cannot access it. Reproduce code: --------------- <?php require_once('Connections/siteData.php'); ?> <?php if (!isset($_SESSION)) { session_start(); } ?> <?php function storPath($fileType){ if(stristr($fileType, ".avi") === TRUE || stristr($fileType, ".mov") === TRUE){ return 'media'; } else { return 'images'; } } $uploadFile = $_SESSION['username']."_". basename($_FILES['Filedata']['name'] ); $storage = storPath($uploadFile); //path name of file for storage $uploadFilePath = $storage."/".$uploadFile; //if the file is moved successfully if ( move_uploaded_file( $_FILES['Filedata']['tmp_name'] , $uploadFilePath ) ) { //populate session array to be passed to SQL $_SESSION['upFile'][] = $uploadFile; echo( '1 ' . $_FILES['Filedata']['name']); //file failed to move }else{ echo( '0'); } ?> Expected result: ---------------- If the uploaded file is named "james_2003.jpg" and $_SESSION['username'] = "wilson" I expect the file to be saved on the server as "wilson_james_2003.jpg". Actual result: -------------- File is saved simply as "_james_2003.jpg". It correct appends"_", however, it doe not append $_SESSION['username']. -- Edit bug report at http://bugs.php.net/?id=37834&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37834&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=37834&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37834&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=37834&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=37834&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=37834&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=37834&r=needscript Try newer version: http://bugs.php.net/fix.php?id=37834&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=37834&r=support Expected behavior: http://bugs.php.net/fix.php?id=37834&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=37834&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=37834&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=37834&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37834&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=37834&r=dst IIS Stability: http://bugs.php.net/fix.php?id=37834&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=37834&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=37834&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=37834&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=37834&r=mysqlcfg

« previous php.bugs (#98441) next »