Tracking adapter may try to set cookie when response headers already sent

Found in

EPiServer.Commerce 11.3.0

Fixed in

EPiServer.Commerce 11.4.0

Created

Nov 09 2017

Updated

Nov 10 2017

Area

Core

State

Closed, Fixed and tested


Description

When a response is returned from the Personalization service, the Commerce integration will pick up the assigned session id and cuid and try to persist those in a cookie on the response to the website client. However, this causes problems in some scenarios. This exception has been observed:

System.Web.HttpException: Server cannot modify cookies after HTTP headers have been sent.

The code should try to avoid this exception by checking if the headers have already been sent before trying to set the cookie.