Working with cookies in JavaScript is far from intuitive. Sitemagic CMS therefore ships with the
SMCookie class that greately simplifies working with cookies, as the code sample below proves.
// Create cookie called StartPage with the value news.php. It expires after 365 days
SMCookie.SetCookie("StartPage", "news.php", 365 * 24 * 60 * 60);
// Get cookie value, display it in a message dialog
SMMessageDialog.ShowMessageDialog("Start page selected: " + SMCookie.GetCookie("StartPage"));
// Remove cookie
SMCookie.RemoveCookie("StartPage");