• HttpCookie Class


    HttpCookie Class

    Provides a type-safe way to create and manipulate individual HTTP cookies.

    Remarks

    The HttpCookie class gets and sets properties of individual cookies. The HttpCookieCollection class provides methods to store, retrieve, and manage multiple cookies.

    ASP.NET includes two intrinsic本质的,固有的 cookie collections. The collection accessed through the Cookies collection of the HttpRequest object contains cookies transmitted传输 by the client to the server in the Cookie header. The collection accessed through the Cookies collection of the HttpResponse object contains new cookies created on the server and transmitted to the client in the Set-Cookie HTTP response header.

    Properties

    Table 2
    Domain

    Gets or sets the domain to associate the cookie with.

    Expires

    Gets or sets the expiration date and time for the cookie.

    HasKeys

    Gets a value indicating whether a cookie has subkeys.

    HttpOnly

    Gets or sets a value that specifies whether a cookie is accessible by client-side script.

    Item[String]

    Gets a shortcut to the Values property. This property is provided for compatibility with previous versions of Active Server Pages (ASP).

    Name

    Gets or sets the name of a cookie.

    Path

    Gets or sets the virtual path to transmit with the current cookie.

    SameSite

    Gets or sets the value for the SameSite attribute of the cookie.

    Secure

    Gets or sets a value indicating whether to transmit the cookie using Secure Sockets Layer (SSL)--that is, over HTTPS only.

    Shareable

    Determines whether the cookie is allowed to participate in output caching.

    Value

    Gets or sets an individual cookie value.

    Values

    Gets a collection of key/value pairs that are contained within a single cookie object.

    HttpCookie.SameSite Property

    Gets or sets the value for the SameSite attribute of the cookie.

    One of the enumeration values that represents the enforcement执行,实施;强制 mode of the cookie or (SameSiteMode)(-1) (represented by the string Unspecified in config files). The default value depends on updates. For more information on defaults and recent updates, see Remarks.

    Remarks

    The default value of this property was modifed by updates described in KB article 4531182 and KB article 4524421.

    Without these updates, the default value is SameSiteMode.None, which does not emit发出,放射;发行;发表 the SameSite cookie header. This conforms to https://tools.ietf.org/html/draft-west-first-party-cookies-07#section-4.1.

    After these updates have been applied, the default value is (SameSiteMode)(-1), which corresponds to Unspecified. This preserves the earlier behavior. Setting SameSiteMode.None causes "SameSite=None" to be emitted. This new behavior conforms to https://tools.ietf.org/html/draft-west-cookie-incrementalism-00.

  • 相关阅读:
    递归分治策略
    矩阵连乘问题
    棋盘覆盖问题
    选择排序
    Dijkstra的双栈算术表达式求值算法
    斐波那契数列
    二分算法
    Linux服务器上tengine的安装配置
    Excel Sheet Column Number
    Excel Sheet Column Title
  • 原文地址:https://www.cnblogs.com/chucklu/p/13177117.html
Copyright © 2020-2023  润新知