Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Horde/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ public function destroy()
}

/* Fallback for legacy/test contexts without an injector. */
if (isset($_SESSION)) {
if (session_status() === PHP_SESSION_ACTIVE) {
session_destroy();
}
$_SESSION = [];
Expand Down
5 changes: 4 additions & 1 deletion src/Session/SessionLifecycle.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,10 @@ public function clean(): bool
*/
public function destroy(): void
{
if (isset($_SESSION)) {
// $_SESSION may be initialised (Horde_Session constructor sets it to
// []) without an active PHP session. session_status() is the
// authoritative guard; $this->active mirrors it for the normal path.
if ($this->active || session_status() === PHP_SESSION_ACTIVE) {
session_destroy();
}
$_SESSION = [];
Expand Down
Loading