从ASP.NET MVC和C#中的Container中检索cookie

时间:2010-07-14 17:11:33

标签: c# .net asp.net asp.net-mvc cookies

//Controller code
CookieContainer cookieContainer = new CookieContainer();
//makes new cookie here
cookieContainer.Add(myCookie);


//Service/Facade code
//myCookie gets passed here

如何将Cookie从容器中取出以确保它是正确的Cookie?

1 个答案:

答案 0 :(得分:1)

假设您尝试将Cookie与Web服务一起使用,请查看此Microsoft支持文章:

HOW TO: Use CookieContainer to Maintain a State in Web Services When You Use Visual C# .NET