/*
|--------------------------------------------------------------------------
| HTTPS Only Cookies
|--------------------------------------------------------------------------
|
| By setting this option to true, session cookies will only be sent back
| to the server if the browser has a HTTPS connection. This will keep
| the cookie from being sent to you if it can not be done securely.
|
*/
'secure' => true,
2条答案
按热度按时间juzqafwq1#
您需要使用
session_set_cookie_params
覆盖默认设置,将$secure标志设置为true,更多信息php.net
在laravel中,你需要修改配置文件session/session.php,将secure标志设置为true
在laravel的新版本中,你可以简单地在
.env
文件中设置SESSION_SECURE_COOKIE=true
vulvrdjw2#
您可以在
config/session.php
文件中设置secure
true 的值,如下所示;