Skip to main content

Cookie ObjectCookie对象

  • name string - The name of the cookie.cookie的名称。
  • value string - The value of the cookie.cookie的值。
  • domain string (optional) - The domain of the cookie; this will be normalized with a preceding dot so that it's also valid for subdomains.cookie的域;这将用前面的一个点进行规范化,这样它对子域也是有效的。
  • hostOnly boolean (optional) - Whether the cookie is a host-only cookie; this will only be true if no domain was passed.cookie是否为仅限主机的cookie;只有在没有通过域的情况下,才会是true
  • path string (optional) - The path of the cookie.cookie的路径。
  • secure boolean (optional) - Whether the cookie is marked as secure.cookie是否标记为安全。
  • httpOnly boolean (optional) - Whether the cookie is marked as HTTP only.cookie是否标记为仅HTTP。
  • session boolean (optional) - Whether the cookie is a session cookie or a persistent cookie with an expiration date.cookie是会话cookie还是具有过期日期的持久cookie。
  • expirationDate Double (optional) - The expiration date of the cookie as the number of seconds since the UNIX epoch. cookie的过期日期,即自UNIX epoch以来的秒数。Not provided for session cookies.不提供会话cookie。
  • sameSite string - The Same Site policy applied to this cookie. 应用于此cookie的同一站点策略。Can be unspecified, no_restriction, lax or strict.可以是unspecifiedno_restrictionlaxstrict