加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 运营中心 > Nginx > 正文

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

发布时间:2020-12-13 21:17:35 所属栏目:Nginx 来源:网络整理
导读:我有运行PHP和WordPress的Nginx. Acunetix建议设置这些标志,但它们不提供任何文档.我看了一下,但我还没有看到任何显示如何实现这一点的东西.我有这个模块:在Nginx上http://wiki.nginx.org/HttpHeadersMoreModule,如果这会有所帮助.有关如何设置这些标志的任

我有运行PHP和WordPress的Nginx. Acunetix建议设置这些标志,但它们不提供任何文档.我看了一下,但我还没有看到任何显示如何实现这一点的东西.我有这个模块:在Nginx上http://wiki.nginx.org/HttpHeadersMoreModule,如果这会有所帮助.有关如何设置这些标志的任何信息?谢谢.

按此处要求的cookie样本

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); testing=1; sid=a14-shortened-384; sessiontest=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+check; wordpress_logged_in_a9-shortened-d2a7=DrDinosaur%7C1397980-shortened-2f9

最佳答案
编辑您的php.ini并设置session.cookie_httponly和session.cookie_secure或在您的应用程序中使用setcookie.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读