Skip to content

Commit

Permalink
fix: remove duplicate scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
obarbosa89 committed Dec 29, 2024
1 parent 925312f commit 66a160b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,10 @@ private function setRouter(): void

$cookieAttributes = CookieAttributes::default()
->withDomain($this->getAppDomain())
->withExpiry(Date::now()->addMinutes(30)->toDateTime());
->withExpiry(Date::now()->addMinutes(30)->toDateTime())
->withSameSite(CookieAttributes::SAMESITE_LAX);

// app.ssl or app.secure or app_server_cert
if (Config::get('session.secure', false)) {
$cookieAttributes->withSecure();
}
Expand All @@ -162,8 +164,7 @@ private function setRouter(): void

private function getAppDomain(): string
{
$protocol = Config::get('session.secure', false) ? 'https://' : 'http://';

return $protocol . Config::get('app.url') . ':' . Config::get('app.port');
// Scheme: http or https
return Config::get('app.url') . ':' . Config::get('app.port');
}
}

0 comments on commit 66a160b

Please sign in to comment.