From: spam at taylorw dot com Operating system: Linux - 2.6.8-gentoo-r3 PHP version: Irrelevant PHP Bug Type: Session related Bug description: New Session created for every session_start() call.
Description: ------------ I have tried 4.3.9 and 5.0.2 (both emerged via gentoo) with various Apache 2.0.5x versions (currently using 2.0.52)... none seem to solve this problem. Anytime session_start(); is called a new session is created, along with a new session_id. I have verified that /tmp is where the sessions are being stored, and have watched the directory as I refreshed a page with nothing but session_start(); in it, and a new session is created each time. And session autostart is not on in php.ini. Relevant php.ini information: session.save_handler = files session.save_path = /tmp session.use_cookies = 1 session.name = PHPSESSID session.auto_start = 0 session.cookie_lifetime = 0 session.cookie_path = / session.cookie_domain = session.serialize_handler = php session.gc_probability = 1 session.gc_divisor = 100 session.gc_maxlifetime = 1440 session.bug_compat_42 = 1 session.bug_compat_warn = 1 session.referer_check = session.entropy_length = 0 session.entropy_file = ;session.entropy_length = 16 ;session.entropy_file = /dev/urandom session.cache_limiter = nocache session.cache_expire = 180 session.use_trans_sid = 0 Reproduce code: --------------- /* Page One (page1.php)*/ <?php session_start(); echo session_id(); ?> <a href="page2.php">click here for page 2</a> /* Page Two (page2.php)*/ <?php session_start(); echo session_id(); ?> <a href="page2.php">click here for page one</a> Expected result: ---------------- The echo'ed session_id()'s should be the same for both pages, and no new session file should exist in /tmp . Actual result: -------------- The session id's differ, and a new session file has been created in /tmp . Refreshing either page creates another session file in /tmp as well. -- Edit bug report at http://bugs.php.net/?id=30789&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30789&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30789&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30789&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=30789&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=30789&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=30789&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=30789&r=needscript Try newer version: http://bugs.php.net/fix.php?id=30789&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=30789&r=support Expected behavior: http://bugs.php.net/fix.php?id=30789&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=30789&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=30789&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=30789&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30789&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=30789&r=dst IIS Stability: http://bugs.php.net/fix.php?id=30789&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=30789&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=30789&r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=30789&r=mysqlcfg