究竟如何配​​置httpOnlyCookies在ASP.NET? [英] How exactly do you configure httpOnlyCookies in ASP.NET?

查看:381
本文介绍了究竟如何配​​置httpOnlyCookies在ASP.NET?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这CodingHorror文章保护您的饼干:仅Http 灵感来​​自

Inspired by this CodingHorror article, "Protecting Your Cookies: HttpOnly"

你如何设置该属性?在网络配置的地方?

How do you set this property? Somewhere in the web config?

推荐答案

如果你使用ASP.NET 2.0或更高版本,可以在Web.config文件中打开它。在<的System.Web>部分中,添加以下行:

If you're using ASP.NET 2.0 or greater, you can turn it on in the Web.config file. In the <system.web> section, add the following line:

<httpCookies httpOnlyCookies="true"/>

这篇关于究竟如何配​​置httpOnlyCookies在ASP.NET?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆