/// <summary> /// Adds a ASP.NET cookie with encrypted forms auth ticket along with user data. /// </summary> public void Save() { // create encrypted cookie string userData = (values == null) ? string.Empty : values.ToString(false); HttpCookie authCookie = CreateCookie(this.Name, userData); // Manually add the authCookie to the Cookies collection HttpContext.Current.Response.Cookies.Add(authCookie); }
protected virtual string GetContextToken(ReponseRepoMonitor repoMon, ScorableResponse scorableResponse) { WebValueCollection tokenData = new WebValueCollection(); tokenData.Set("oppKey", scorableResponse.OppKey); tokenData.Set("itemKey", scorableResponse.ItemKey); tokenData.Set("position", scorableResponse.Position); tokenData.Set("sequence", scorableResponse.ResponseSequence); tokenData.Set("scoremark", scorableResponse.ScoreMark); tokenData.Set("hubDBIP", repoMon.DBIP); tokenData.Set("hubDBName", repoMon.DBName); tokenData.Set("clientName", repoMon.ClientName); tokenData.Set("environment", repoMon.Environment); return(EncryptionHelper.EncryptToBase64(tokenData.ToString(false))); // encrypt token (do not url encode) }