|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-10-14 16:20 UTC] 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, '/');
}
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Jun 16 20:00:02 2026 UTC |
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"] ); }