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 the value of cookies with subcookies 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 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
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: Stringan HTTP cookie value as a String if existing, null (Nothing in Visual Basic) otherwise.
Remarks
Examples
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