0

Our multi-site Sitecore instance (7.0.- rev-130424) is setting same language cookie multiple times like below in response headers:

Set-Cookie: SiteName#lang=de-DE; path=/; secure; HttpOnly 
Set-Cookie:  SiteName#lang=de-DE; path=/; secure; HttpOnly 
Set-Cookie:  SiteName#lang=de-DE; path=/; secure; HttpOnly

This is happening like 40-50 odd times in some pages, because of the exceeded header counts, load balancers are not processing those pages. Have any of you faced this issue before?

4
  • Have you checked all the subsequent 7.x release notes to see if this problem has been fixed ? Is it possible for you to upgrade to 8.2 update 7 ? Commented Jan 17, 2019 at 10:52
  • Could you check to GET parameters of the request? I suspect there are more than one sc_lang=de-DE. If it's true, then it may be processed several times by the SetLanguage processor. Commented Jan 17, 2019 at 12:08
  • No option to upgrade. I have checked release notes i could not find it as a known issue. Commented Jan 17, 2019 at 12:51
  • I have checked the GET parameters and there are no duplicates of sc_lang @RomanKlimenko Commented Jan 17, 2019 at 14:51

1 Answer 1

1

I know this answer is late but just answering in case it might help someone else. I believe this is an ASP .NET bug more details can be found in this SO answer. Putting below code in the EndRequest event fixed this for me:

try
{
    var guid = Guid.NewGuid();
    HttpContext.Current.Response.Cookies.Add(new HttpCookie(guid.ToString(), string.Empty));
    HttpContext.Current.Response.Cookies.Remove(guid.ToString());
}
catch (HttpException)
{
    //This means the headers were already written,
    //in which case we need not do anything.
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.