开发者

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜