Skip to content

Commit e28a41f

Browse files
Update SessionManager.php
1 parent f9fcb3e commit e28a41f

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/SessionManager.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,15 @@ public function start(): bool
9696
*/
9797
public function stop(): bool
9898
{
99-
$_SESSION = array();
100-
if (ini_get("session.use_cookies")) {
101-
$params = session_get_cookie_params();
102-
setcookie(session_name(), '', time() - 42000,
103-
$params["path"], $params["domain"],
104-
$params["secure"], $params["httponly"]
105-
);
99+
// Attempt to destory the session if running.
100+
try {
101+
$this->isRunning();
102+
} catch (SessionRunningException $e) {
103+
$this->clear();
104+
$this->voidSessionCookie();
106105
}
107-
return session_destroy();
106+
$this->freeSessionID();
107+
$this->destroySession();
108108
}
109109

110110
/**

0 commit comments

Comments
 (0)