Skip to content

Commit

Permalink
Merge pull request #79 from aleksip/headers-sent
Browse files Browse the repository at this point in the history
Early return from SessionManager::destroy() if headers have already been sent
  • Loading branch information
weierophinney authored Feb 29, 2024
2 parents 710afdc + dcf8fe8 commit 42f30f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/SessionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ protected function initializeValidatorChain()
*/
public function destroy(?array $options = null)
{
if (! $this->sessionExists()) {
if (headers_sent() || ! $this->sessionExists()) {
return;
}

Expand Down

0 comments on commit 42f30f2

Please sign in to comment.