网站 Cookie only 唯一 防止被截获
2024-08-24 01:38:32
void Page_Load(object sender, EventArgs e)
{
// Create a new HttpCookie.
HttpCookie myHttpCookie = new HttpCookie("LastVisit", DateTime.Now.ToString()); // By default, the HttpOnly property is set to false
// unless specified otherwise in configuration. myHttpCookie.Name = "MyHttpCookie";
Response.AppendCookie(myHttpCookie); // Show the name of the cookie.
Response.Write(myHttpCookie.Name); // Create an HttpOnly cookie.
HttpCookie myHttpOnlyCookie = new HttpCookie("LastVisit", DateTime.Now.ToString()); // Setting the HttpOnly value to true, makes
// this cookie accessible only to ASP.NET.
myHttpOnlyCookie.HttpOnly = true;
myHttpOnlyCookie.Name = "MyHttpOnlyCookie";
Response.AppendCookie(myHttpOnlyCookie); // Show the name of the HttpOnly cookie.
Response.Write(myHttpOnlyCookie.Name);
}
最新文章
- js下载项目中的文件
- PHP变量入门教程(4)PHP 的外部变量
- LeetCode Maximum Depth of Binary Tree (求树的深度)
- centos下redis安装
- html 标签释义
- SharePoint 2013 讨论板列表";Connect to Outlook"; 不可用解决方案
- RVDS 3.1 下载地址及破解方法
- mybatis入门介绍一
- react入门之使用webpack搭配环境(一)
- IDL 结构体
- c语言字符相关函数
- Android程序崩溃异常收集框架
- 面试之路(4)-TCP/IP/HTTP概述
- ApplicationContextAware 接口的作用
- Virtual DOM 系列三:Diff算法
- 【转载】ASP.NET Core Web 支付功能接入 微信-扫码支付篇
- 元组tuple 可迭代对象
- jquery日常使用总结
- poj3126
- Java8 list根据对象某个属性去重