为 cookie 设置安全标志 Symfony Azure

Set secure flag for cookies Symfony Azure

我必须为我的网站 cookie 设置安全标志。我的网站在 Symfony 3.4 中,并且部署在 Azure 上。我已经在 web.config 文件的 <system.webServer> 下尝试了这条规则 <httpCookies requireSSL="true" httpOnlyCookies="true"/> 但它不起作用,我也尝试在 <system.web> 下添加这个标签,但没有成功。

我已经在我的 symphony 配置中进行了设置,并针对我的应用程序创建的那些 cookie 对其进行了排序。我不必在 web.config.

之前完成

config.yml 文件中设置以下这些参数。

config.yml

framework:
    session:
        cookie_httponly: true
        cookie_secure: true