public void TestParse() { const string cookieValue = "test%7Ctest%40.linkme.com.au%7Ctest%2Btest"; var data = ExternalCookieData.ParseCookieValue(cookieValue); Assert.AreEqual("test", data.ExternalId); Assert.AreEqual("*****@*****.**", data.EmailAddress); Assert.AreEqual("", data.FirstName); Assert.AreEqual("test+test", data.LastName); }
protected void CreateExternalCookies(ReadOnlyUrl url, string externalId, string emailAddress, string name, string cookieDomain) { var cookieValue = new ExternalCookieData(externalId, emailAddress, name).CookieValue; var cookie = new Cookie(ExternalCookieName, cookieValue) { Domain = cookieDomain }; // Cookie Uri should be with a path "/". var cookieUrl = url.AsNonReadOnly(); cookieUrl.Path = "/"; var uri = new Uri(cookieUrl.AbsoluteUri); Browser.Cookies.Add(uri, cookie); }