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);
}

最新文章

  1. js下载项目中的文件
  2. PHP变量入门教程(4)PHP 的外部变量
  3. LeetCode Maximum Depth of Binary Tree (求树的深度)
  4. centos下redis安装
  5. html 标签释义
  6. SharePoint 2013 讨论板列表"Connect to Outlook" 不可用解决方案
  7. RVDS 3.1 下载地址及破解方法
  8. mybatis入门介绍一
  9. react入门之使用webpack搭配环境(一)
  10. IDL 结构体
  11. c语言字符相关函数
  12. Android程序崩溃异常收集框架
  13. 面试之路(4)-TCP/IP/HTTP概述
  14. ApplicationContextAware 接口的作用
  15. Virtual DOM 系列三:Diff算法
  16. 【转载】ASP.NET Core Web 支付功能接入 微信-扫码支付篇
  17. 元组tuple 可迭代对象
  18. jquery日常使用总结
  19. poj3126
  20. Java8 list根据对象某个属性去重

热门文章

  1. 只要三步,使用html5+js实现像素风头像生成器
  2. LeetCode第二十三题-合并n个有序链表
  3. 机器学习基石8-Noise and Error
  4. 7zip,命令行解压报错:7-Zip cannot find the code that works with archives.
  5. 共有49款Windows GUI开发框架开源软件 【转】
  6. 强行杀windows服务
  7. [insight] debug
  8. NodeJS Addon 多线程通信
  9. Centos7创建支持ssh服务的docker镜像
  10. rsync问题