Click or drag to resize
CookieHelperSetValue Method (String, String, DateTime, String, NullableBoolean, String, SameSiteMode, Boolean)
Sets the cookie.

Namespace: CMS.Helpers
Assembly: CMS.Helpers (in CMS.Helpers.dll) Version: 13.0.131
Syntax
C#
public static void SetValue(
	string name,
	string value,
	DateTime expires,
	string path = null,
	Nullable<bool> httpOnly = null,
	string domain = null,
	SameSiteMode sameSiteMode = SameSiteMode.Lax,
	bool secure = false
)

Parameters

name
Type: SystemString
Cookie name
value
Type: SystemString
Cookie value
expires
Type: SystemDateTime
Expiration time
path (Optional)
Type: SystemString
Cookie virtual path
httpOnly (Optional)
Type: SystemNullableBoolean
Defines httpOnly flag.
domain (Optional)
Type: SystemString
Domain to associate the cookie with.
sameSiteMode (Optional)
Type: CMS.BaseSameSiteMode
Value of the same site attribute.
secure (Optional)
Type: SystemBoolean
Indicates whether the cookie should contain the secure attribute.
See Also