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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: sharkykz at gmail dot com
New email:
PHP Version: OS:

 

 [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: Thu Apr 25 16:01:28 2024 UTC