首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式碼之家 >> 編程語言 >  >> .NET 網頁程式設計 >> ASP.NET 基礎 >> 關於ASP.NET

IsLine Framework 系列(十二):HttpContentProvider —— Session、Cookie 與安全支援

     編輯:關於ASP.NET

CookieProvider 為全站統一管理 Cookie 屬性:加密、HttpOnly、Secure、Domain。

配置區段

<sectionGroup name="IsLine.HttpContent.Configuration">
  <section name="Cookie" type="IsLine.Data.Configuration.SuitConfig" />
</sectionGroup>

<IsLine.HttpContent.Configuration>
  <Cookie>
    <Cryptography>False</Cryptography>
    <IsHttpOnly>True</IsHttpOnly>
    <IsSecure>False</IsSecure>
    <Domain>Default</Domain>
  </Cookie>
</IsLine.HttpContent.Configuration>

屬性詳解

  • Cryptography:啟用 IsLine.Security.Cryptography 加解密,種子鍵 IsLine.Security.Configuration.TokenKey
  • IsHttpOnly:防止 JavaScript/Flash 存取,需 IE6 SP1+
  • IsSecure:僅 HTTPS 傳輸,本地檔案不加密(需配合 Cryptography)
  • Domain:跨子網域共享 Cookie,如 abc.com 涵蓋 www.abc.com、isline.abc.com

初始化自動載入配置,程式碼無需重複定義屬性,實現全站唯一屬性入口。

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式碼之家 All Rights Reserved