CookieOptions

Namespace: ASPSecurityKit
Assembly: ASPSecurityKit.dll

Summary

Represents various options (attributes) available for HTTP cookie.

Remarks

Check out excellent MDN reference on cookie: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie.

Properties

Path

Summary

Gets or sets the path attribute.

Value

The path attribute.

Remarks

The default is ‘/’ which represents the root path and means that the cookie will be sent by the browser regardless of the page path on the host.

Domain

Summary

Gets or sets the domain attribute.

Value

The domain attribute.

Remarks

If domain isn’t specified, the cookie will be sent only to the host of current URL (not including subdomains). If it is specified, the cookie will be sent to its subdomains as well.

Secure

Summary

Gets or sets the secure attribute.

Value

The secure attribute.

Remarks

If secure is set, browser will only send the cookie on secure https requests.

HttpOnly

Summary

Gets or sets the HttpOnly attribute.

Value

The HttpOnly attribute.

Remarks

If HttpOnly is set, cookie won’t be accessible via javascript on the browser.

SameSite

Summary

Gets or sets the same site attribute.

Value

The same site attribute.

ExpiresIn

Summary

Gets or sets the interval after which the cookie is considered expired.

Value

The interval after which the cookie is considered expired.

Remarks

This property sets the expires attribute. If not specified, expires isn’t set and the cookie is considered alive only for the duration of the current browser session. Use this for creating long-alive sessions (for instance when user selects RememberMe option on login).