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

From: Date: Fri, 13 Nov 2009 20:49:20 +0000
Subject: #49877 [Opn->Csd]: 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-3128@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 +Status: Closed Bug Type: Documentation problem PHP Version: Irrelevant New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. Previous Comments: ------------------------------------------------------------------------ [2009-11-13 20:49:07] vrana@php.net 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"] ); } ------------------------------------------------------------------------ [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 (#3128) next »