php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79587 SessionHandler::destroy() works only once
Submitted: 2020-05-11 16:12 UTC Modified: 2020-05-12 14:45 UTC
From: sharkykz at gmail dot com Assigned: cmb (profile)
Status: Not a bug Package: Session related
PHP Version: Irrelevant OS: Any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
42 + 39 = ?
Subscribe to this entry?

 
 [2020-05-11 16:12 UTC] sharkykz at gmail dot com
Description:
------------
Calling SessionHandler::destroy() multiple times destroys only first session.

Test script:
---------------
// Basic setup.
$handler = new \SessionHandler;
session_set_save_handler($handler);
session_start();

// Array of session IDs.
$sessionsToDestroy = array(
	'sessionId1',
	'sessionId2',
	'sessionId3',
);

// Attempt to destroy the sessions.
foreach ($sessionsToDestroy as $sessionId)
{
	$handler->destroy($sessionId);
}

Expected result:
----------------
All passed sessions destroyed.

Actual result:
--------------
Only the first session is destroyed.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-05-12 14:45 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2020-05-12 14:45 UTC] cmb@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

From the PHP manual[1]:

| Please note the callback methods of this class are designed to
| be called internally by PHP and are not meant to be called from
| user-space code. The return values are equally processed
| internally by PHP.

[1] <https://www.php.net/SessionHandler>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 30 00:01:30 2024 UTC