Expiry cookie of microsite in different website in C# RRS feed

  • Question

  • Hi,

    Here's my scenario.

    i have a partner site, where we create a cookie "media.type" with domain name ".broadcast.com". There is a button which redirects to a different site whose url is "dev.account.broadcast.com" and the same cookie is used here. I am able to read this cookie but not able to expiry it. 

    I tried the below options, but didnt work

    1. HttpContext.Current.Response.Cookies["media.type"].Expires = DateTime.Now.AddDays(-1d);
    2. var cookie = System.Web.HttpContext.Current.Response.Cookies["media.type"];
      cookie.Value = null;
      cookie.Expires = DateTime.Now.AddDays(-1);

    Could anyone please help me on this issue.

    • Moved by CoolDadTx Monday, June 4, 2018 2:38 PM ASP.NET related
    Friday, June 1, 2018 9:21 PM

All replies

  • All Web issues can be discussed at the ASP.NET forums.


    Friday, June 1, 2018 10:22 PM
  • Hi Venky_Ferrari,

    Since your question is more related to web, please post a new thread in ASP.NET forum for suitable support.


    The Visual C# forum discuss and ask questions about the C# programming language, IDE, libraries, samples, and tools.

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, June 4, 2018 7:07 AM
  • I did post their, but no one seems to respond or give a solution
    Wednesday, June 6, 2018 3:05 PM