Create new cookie to edit its value
I know that you can't edit incoming cookies. I have a cookie that I just need to read..nothing more but I have a need to remove some characters from its value so that I can parse it. How can I do this? I don't need to send the modified new cookie back in the response, it's just for my server-side consumption and then that's it.
Updated:
figured it out:
HttpCookie facebookAuthCookie = HttpContext.Current.Request.Cookies[facebookCookieName];
string cleanValue = facebookAuthCookie.Value.Replace("\"", string.Empty);
HttpCookie cleanedFacebookAuthCookie = new HttpCo开发者_如何学运维okie("cleanedFacebookCookie", cleanValue);
gayness
Is it too simple to say read the values into a local variable and do whatever you want there?
精彩评论