diff --git a/app/Console/Commands/Environment/AppSettingsCommand.php b/app/Console/Commands/Environment/AppSettingsCommand.php index 60254a9ef..01518d610 100644 --- a/app/Console/Commands/Environment/AppSettingsCommand.php +++ b/app/Console/Commands/Environment/AppSettingsCommand.php @@ -144,6 +144,11 @@ class AppSettingsCommand extends Command $this->variables['APP_ENVIRONMENT_ONLY'] = $this->confirm(trans('command/messages.environment.app.settings'), true) ? 'false' : 'true'; } + // Make sure session cookies are set as "secure" when using HTTPS + if (strpos($this->variables['APP_URL'], 'https://') === 0) { + $this->variables['SESSION_SECURE_COOKIE'] = 'true'; + } + $this->checkForRedis(); $this->writeToEnvironment($this->variables); diff --git a/config/session.php b/config/session.php index 2007acb2e..8605db59b 100644 --- a/config/session.php +++ b/config/session.php @@ -188,5 +188,5 @@ return [ | */ - 'same_site' => null, + 'same_site' => env('SESSION_SAMESITE_COOKIE', 'lax'), ];