If a cookie is added in any of the sitecore pipelines, it will already be in HttpContext.Current.Request.Cookies in the next pipeline. I have to check if the browser sent any cookies, but because of this I can't use HttpContext.Current.Request.Cookies as I can't be sure if a cookie in it was sent by the browser or added by code. Is there any solution to this?

When adding cookies in code:


When reading cookies in other pipelines for the same request:

  • Welcome to sitecore stack exchange. Could you please add more details to the question as to where you are trying to read the cookies from the browser and how you are adding them from the pipelines? Apr 13, 2021 at 17:11

1 Answer 1


If you are referring to the cookies that sitecore is using, you can take a look at the documentation to see the full list of cookies https://doc.sitecore.com/developers/93/platform-administration-and-architecture/en/cookies-used-by-sitecore.html. Then in your code you would just handle the rest.

If you need to handle the case where custom cookies might be added in other pipelines, you could implement your own pipeline and have it registered before the custom ones, for example if you take a look at the sitecore pipeline:

    <processor type="Sitecore.Pipelines.PreprocessRequest.CheckIgnoreFlag, Sitecore.Kernel"/>
    <processor type="Sitecore.Pipelines.HttpRequest.EnsureServerUrl, Sitecore.Kernel"/>
    <processor type="Sitecore.Pipelines.HttpRequest.StartMeasurements, Sitecore.Kernel"/>
    <processor type="Sitecore.Analytics.Pipelines.HttpRequest.StartDiagnostics,Sitecore.Analytics" patch:source="Sitecore.Analytics.Tracking.config"/>

You would register your custom processor like this:

     <processor patch:before="processor[@type='Sitecore.Pipelines.HttpRequest.ItemResolver, Sitecore.Kernel']" type="YourNamespace.CustomProcessor, YourProject" />
  • Yes, that's the only solution I could think of too. I wanted to see if this is a known issue or I was just missing something.
    – Aron Toth
    Apr 15, 2021 at 12:24

Your Answer

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

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