|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #20421 session_abort() and session_reset()
Submitted: 2002-11-14 03:19 UTC Modified: 2013-08-10 07:58 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: ernest at vogelsinger dot at Assigned: yohgaki (profile)
Status: Closed Package: Session related
PHP Version: * OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: ernest at vogelsinger dot at
New email:
PHP Version: OS:


 [2002-11-14 03:19 UTC] ernest at vogelsinger dot at
What happens to a session when a script gets aborted? I don't believe there can be a one-shot solution for all situations, and I can easily imagine that one would want to keep the session data, but doesn't want to save anything changed _just_now_ (similar to a transaction rollback).

A function session_abort() or session_reset() could do just this - abort any open session without modifying the session storage. Having such methods one could decide in a registered shutdown function how to proceed.

Works similar to session_write_close() except that it doesn't store session data

Rereads the $_SESSION superglobal from stored session data, destroying any modifications so far. The session remains open.

Thanks for consideration (possibly in 4.3?),


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-29 17:44 UTC]
-Package: Feature/Change Request +Package: Session related -Operating System: any +Operating System: * -PHP Version: 4.2.2 +PHP Version: *
 [2012-03-31 03:39 UTC]
-Assigned To: +Assigned To: yohgaki
 [2013-08-10 07:32 UTC]
-Summary: Would come handy: session_abort() +Summary: session_abort() and session_reset()
 [2013-08-10 07:58 UTC]
-Status: Assigned +Status: Closed
 [2013-08-10 07:58 UTC]
These functions are available 5.6 or later.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 22 18:01:36 2024 UTC