Skip to content

Commit 907984c

Browse files
author
Ibrahim BinAlshikh
committed
fix: use $response instance instead of static Response::addHeader() in StartSessionMiddleware
Response::addHeader() is an instance method, not static. The static call silently fails in PHP 8.x (caught by the Error handler), so the session Set-Cookie header is never added to the response. Fixes #297
1 parent 1faf4a1 commit 907984c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

WebFiori/Framework/Middleware/StartSessionMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function after(Request $request, Response $response) {
2626
$sessionsCookiesHeaders = SessionsManager::getCookiesHeaders();
2727

2828
foreach ($sessionsCookiesHeaders as $headerVal) {
29-
Response::addHeader('set-cookie', $headerVal);
29+
$response->addHeader('set-cookie', $headerVal);
3030
}
3131
} catch (Error $exc) {
3232
}

0 commit comments

Comments
 (0)