mad*_*scu 12
您需要使用覆盖默认设置session_set_cookie_params
,将$ secure标志设置为true,
void session_set_cookie_params ( int $lifetime [, string $path [, string $domain [, bool $secure = false [, bool $httponly = false ]]]] )
Run Code Online (Sandbox Code Playgroud)
php.net上的更多信息
在laravel中,您需要更改config / session.php配置,将secure标志设置为true
/*
|--------------------------------------------------------------------------
| 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,
Run Code Online (Sandbox Code Playgroud)
小智 5
您可以如下所示在文件中设置secure
true的值config/session.php
;
'secure' => env( 'SESSION_SECURE_COOKIE', true ),
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
10839 次 |
最近记录: |