Skip to content

Commit

Permalink
Update maintenance middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
nguereza-tony committed Nov 20, 2023
1 parent 891c63f commit f98037a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/Http/Middleware/MaintenanceMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,17 +252,17 @@ protected function createBypassCookie(string $secret): Cookie
'hash' => hash_hmac('sha256', (string) $expire, $secret)
];
$value = base64_encode(Json::encode($data));

$cookie = new Cookie($name, $value);

$sessionCookieConfig = $this->config->get('session.cookie', []);

$cookie->withExpires($expire)
->withPath($sessionCookieConfig['path'] ?? null)
->withDomain($sessionCookieConfig['domain'] ?? null)
->withSecure($sessionCookieConfig['secure'] ?? false)
->withHttpOnly(true);

$cookie = new Cookie(
$name,
$value,
$expire,
$sessionCookieConfig['domain'] ?? null,
$sessionCookieConfig['path'] ?? null,
$sessionCookieConfig['secure'] ?? false,
true
);

return $cookie;
}
Expand Down

0 comments on commit f98037a

Please sign in to comment.