SiteBaseSetCookie Method (String, String, String) Content Studio 5.7 SDK
Content Studio Web Content Management System

[This is preliminary documentation and is subject to change.]

Sets the value of a non-persistent HTTP cookie with a sub-cookie.

Namespace: ContentStudio.Site
Assembly: CS_SiteLib (in CS_SiteLib.dll) Version: 5.7.5016.0 (5.7.5016.0)
Syntax

public void SetCookie(
	string cookieName,
	string subCookieName,
	string value
)

Parameters

cookieName
Type: SystemString
The name of the cookie
subCookieName
Type: SystemString
The name of the sub-cookie
value
Type: SystemString
The value to set
Remarks

If the cookie exists and contains other sub-cookies these will be preserved. If the cookie exists and was persistent it will be transformed to a non-persistent cookie.
Examples

The following example shows how to set an in-memory cookie value and obtain its value with the GetCookie(String, String) method

const string COOKIE = "MyCookie";
const string SUBCOOKIE = "SubCookie";
SetCookie(COOKIE, SUBCOOKIE, "Cookie & sub-cookie");
Response.Write(Server.HtmlEncode(GetCookie(COOKIE, SUBCOOKIE));
See Also

Reference