Bug #67421 [Opn->Csd]: Provide session_close function for releasing a session without affecting it
| From: | requinix@php.net | Date: | Wed, 11 Jun 2014 17:20:30 +0000 |
| Subject: | Bug #67421 [Opn->Csd]: Provide session_close function for releasing a session without affecting it | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-186152@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=67421&edit=1
ID: 67421
Updated by: requinix@php.net
Reported by: ianbytchek at gmail dot com
Summary: Provide session_close function for releasing a
session without affecting it
-Status: Open
+Status: Closed
Type: Bug
Package: Session related
Operating System: OS X
PHP Version: 5.5.13
-Assigned To:
+Assigned To: requinix
Block user comment: N
Private report: N
New Comment:
Implemented in 5.6 as session_abort().
Previous Comments:
------------------------------------------------------------------------
[2014-06-11 12:17:50] ianbytchek at gmail dot com
Description:
------------
The language currently offers two functions (session_commint() / session_write_close() and
session_destroy()) to close an active session and change the session status from active to none.
However, currently there is no decent way to simply close the session (so that its status is changed
from active to none) without either updating its contents or destroying it.
Normally this would not be required, but there might be situations when the script with an active
session runs another isolated script that uses the same session and updates it. When the second
script finishes and the first one wants to reload the session updated by the second one, there would
be no obvious way of doing that. If we had a session_close function we could simply do:
session_close();
session_start();
My current use case comes from running Behat / Mink test suites. From the current test script the
browser simulator makes a request to the local server, which might result in updating a session,
e.g., sign in action. After response is received by the original script I want to load this session
and make assertions. To make this work I need to either close the session after each set of
assertions or use a session write handler with a dummy destroy / commit function. Neither solution
is bullet proof or natural.
So, I propose to include a new session_close() function, which would simply close the session
without destroying it or updating the remote file / record.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67421&edit=1