diff --git a/config/cookie.php b/config/cookie.php index b6371edf7..9d5fc81f5 100644 --- a/config/cookie.php +++ b/config/cookie.php @@ -20,12 +20,12 @@ return [ 'path' => '/', // cookie 有效域名 'domain' => '', - // cookie 安全传输 - 'secure' => false, // httponly 访问设置 'httponly' => true, // 是否使用 setcookie 'setcookie' => true, - // samesite 设置,支持 'strict' 'lax' - 'samesite' => '', -]; \ No newline at end of file + // cookie 安全传输,只支持 https 协议 + 'secure' => app()->request->isSsl(), + // samesite 安装设置,支持 'strict' 'lax' 'none' + 'samesite' => app()->request->isSsl() ? 'none' : 'lax', +];