SiteBaseGetCookie Method (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

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
)

Parameters

cookieName
Type: SystemString
The name of the cookie

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 cookie values 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";
string coval = GetCookie(COOKIE);
if(coval == null)
  Response.Write("The cookie " + COOKIE + " does not exist or is unspecified");
else
  Response.Write("The cookie " + COOKIE + " has the value: " + Server.HtmlEncode(coval));
See Also

Reference