|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11308 'exit;' causes session_save_handler save routine not to run
Submitted: 2001-06-06 08:13 UTC Modified: 2001-06-08 13:04 UTC
From: jmat at shutdown dot net Assigned:
Status: Closed Package: Session related
PHP Version: 4.0.5 OS: Linux 2.4
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: jmat at shutdown dot net
New email:
PHP Version: OS:


 [2001-06-06 08:13 UTC] jmat at shutdown dot net
When a custom script is used to read/write sessions, and an exit is called in the middle of a script, the session write routine never gets called -- even though when using the internal routines, it does.

This makes scripts that use Header redirects semi-useless, since they can't do 'exit;' to get out of the script as soon as the header is sent.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-06 08:47 UTC] jmat at shutdown dot net
I bypassed this problem, for now by doing a 

do {


} while(0);

and using 'break'; to jump out of the script.. but shouldn't the internal handler act the same as the 'user defined' handlers?  if 'exit' causes the internal-files handler to save the session, the user-defined one should run, as well... 
 [2001-06-08 13:04 UTC]
They get called, but you cannot output text from there.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Mar 24 19:03:39 2023 UTC