Content Studio Web Content Management System
Assembly: CS_SiteLib (in CS_SiteLib.dll) Version: 5.7.5016.0 (5.7.5016.0)
an HTTP cookie value as a String if existing, null (Nothing in Visual Basic) otherwise.
Event though there are native methods of getting cookies in ASP.NET this method makes
the task of reading cookie values much simpler.
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.
[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
Parameters
- cookieName
- Type: SystemString
The name of the cookie
Return Value
Type: Stringan HTTP cookie value as a String if existing, null (Nothing in Visual Basic) otherwise.
Remarks
Examples
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