在 Nginx 和 PHP 上添加“HttpOnly”和“Secure”cookie 标志

DrD*_*aur 4 php nginx wordpress http-cookie

我使用 PHP 和 WordPress 运行 Nginx。Acunetix 建议设置这些标志,但它们不提供任何文档。我环顾四周,但我还没有看到任何能确切说明如何实现这一点的东西。我有这个模块:http : //wiki.nginx.org/HttpHeadersMoreModule on Nginx 如果有帮助的话。有关如何设置这些标志的任何信息?谢谢。

根据此处的要求,cookie 示例

饼干:__cfduid=d3-shortened-08;cf_use_ob=0; wordpress_logged_in_6dfda-shortened-e3e82d5; __utma=21-shortened-436.19; __utmc=21519150;__utmz=2119150.1396063475.3.2.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmct??r=(not%20provided); 测试=1;sid=a14-shortened-384; 会话测试=1;wp-settings-2=editor%3Dhtml%26wplink%3D0%26uploader%3D1%26mfold%3Do%26ed_size%3D??677%26libraryContent%3Dbrowse%26urlbutton%3Dfile; wp-settings-time-2=139745167; wordpress_test_cookie=WP+Cookie+检查;wordpress_logged_in_a9-shortened-d2a7=DrDinosaur%7C1397980-shortened-2f9

HTT*_*500 5

编辑您的 php.ini 并设置session.cookie_httponlysession.cookie_secure或在您的应用程序中使用setcookie