From: [EMAIL PROTECTED] Operating system: BSD/OS 4.2 PHP version: 4.3.0 PHP Bug Type: Session related Bug description: Unsetting $_COOKIE[session_name()] shouldn't warn, but send new cookie
The following script: <?php error_reporting(E_ALL); if(isset($_COOKIE[session_name()]) && !file_exists(session_save_path(NULL) . '/sess_' . session_id(NULL))) unset($_COOKIE[session_name()]); ini_set('session.use_only_cookies', TRUE); ini_set('session.cookie_lifetime', 7 * 24 * 3600); ini_set('session.gc_lifetime', 7 * 24 * 3600); session_start(); ?> <html> <body> <a href="<?php echo $_SERVER['PHP_SELF']; ?>?foo=<?php echo time(); ?>">refresh</a> <pre> <?php var_dump($_SESSION); ?> </pre> </body> </html> <?php $_SESSION['test'] = 'hi' . $_GET['foo']; ?> Creates warnings about illegal chars in the session id. However - there is no valid session here, as there is no valid cookie. It should send a new cookie instead, with a new generated session id. However - it sets an empty id: Set-Cookie: PHPSESSID=; expires=Wed, 29-Jan-2003 17:37:42 GMT; path=/ If I also unset $_SESSION, it doesn't change anything. -- Edit bug report at http://bugs.php.net/?id=21821&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=21821&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=21821&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=21821&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=21821&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=21821&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=21821&r=support Expected behavior: http://bugs.php.net/fix.php?id=21821&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=21821&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=21821&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=21821&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21821&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=21821&r=dst IIS Stability: http://bugs.php.net/fix.php?id=21821&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=21821&r=gnused