Content Studio Web Content Management System
Assembly: CS_SiteLib (in CS_SiteLib.dll) Version: 5.7.5016.0 (5.7.5016.0)
If the cookie contains other sub-cookies these will be overwritten.
The following example shows how to set a persistent cookie that lasts for a month and obtain its value with the GetCookie(String) method
[This is preliminary documentation and is subject to change.]
Sets the value of an HTTP cookie with a specific expiration 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 - value
- Type: SystemString
The value to set - expires
- Type: SystemDateTime
A value that indicates when the cookie should expire
Remarks
Examples
const string COOKIE = "MyCookie"; DateTime ExpiresDate = DateTime.Now.AddMonths(1); SetCookie(COOKIE, "Cookie value", ExpiresDate); Response.Write(Server.HtmlEncode(GetCookie(COOKIE));
See Also