php.net |  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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
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.

Patches

Pull Requests

History

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] sas@php.net
They get called, but you cannot output text from there.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Feb 05 08:01:30 2025 UTC