#49877 [Opn]: session_destroy example does not take session domain into account

From: Date: Fri, 13 Nov 2009 20:49:07 +0000
Subject: #49877 [Opn]: session_destroy example does not take session domain into account
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-3127@lists.php.net to get a copy of this message
ID: 49877 Updated by: vrana@php.net Reported By: php at dmi dot me dot uk Status: Open Bug Type: Documentation problem PHP Version: Irrelevant New Comment: Changed to: if (ini_get("session.use_cookies")) { $params = session_get_cookie_params(); setcookie(session_name(), '', time() - 42000, $params["path"], $params["domain"], $params["secure"], $params["httponly"] ); } Previous Comments: ------------------------------------------------------------------------ [2009-11-13 20:48:51] svn@php.net Automatic comment from SVN on behalf of vrana Revision: http://svn.php.net/viewvc/?view=revision&revision=290693 Log: Improve example (bug #49877) ------------------------------------------------------------------------ [2009-10-14 16:20:49] php at dmi dot me dot uk Description: ------------ Example on session_destroy() page is incorrect; it blindly assumes that the session cookie domain is the same as the hostname. Reproduce code: --------------- --- Example #1 from manual page: function.session-destroy#Examples --- Expected result: ---------------- if (isset($_COOKIE[session_name()])) { setcookie(session_name(), ini_get('session.cookie_domain'), time()-42000, '/'); } Actual result: -------------- if (isset($_COOKIE[session_name()])) { setcookie(session_name(), '', time()-42000, '/'); } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=49877&edit=1

« previous php.doc.bugs (#3127) next »