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

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

Gets an HTTP cookie value with a specified sub-cookie

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

public string GetCookie(
	string cookieName,
	string subCookieName
)

Parameters

cookieName
Type: SystemString
The name of the cookie
subCookieName
Type: SystemString
The name of the sub-cookie. This argument can be null (Nothing in Visual Basic) if no subcookie is requested.

Return Value

Type: String
an HTTP cookie value as a String if existing, null (Nothing in Visual Basic) otherwise.
Remarks

Event though there are native methods of getting cookies in ASP.NET this method makes the task of reading the value of cookies with subcookies much simpler.
Examples

This example shows how to get the value of a cookie. The code checks if the cookie exists or has been specified and writes its value.

const string COOKIE = "MyCookie";
const string SUBCOOKIE = "SubCookie";
string coval = GetCookie(COOKIE, SUBCOOKIE);
if(coval == null)
  Response.Write("The cookie " + COOKIE + "." + SUBCOOKIE + " does not exist or is unspecified");
else
  Response.Write("The cookie " + COOKIE + "." + SUBCOOKIE + " has the value: " + Server.HtmlEncode(coval));
See Also

Reference