1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Server cannot modify cookies after HTTP headers have been sent

Server cannot modify cookies after HTTP headers have been sent

1 posts, 0 answered
  1. Zhi
    Zhi avatar
    10 posts
    Registered:
    27 Sep 2010
    16 Aug 2011
    Link to this post

    Do you know what might be causing this error?  We have a page which calls a PokeIn script by using an ASP page to render a javascript include.

    <script src="Handler.aspx?ms=connect">

    On viewing

    Handler.aspx?ms=connect


    We get the following error:

    The page works fine as a standalone outside of Sitefinity.  What might we be doing wrong?

    Server Error in '/' Application.

    Server cannot modify cookies after HTTP headers have been sent.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

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

    Source Error: 

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace: 

    [HttpException (0x80004005): Server cannot modify cookies after HTTP headers have been sent.]
       System.Web.HttpResponse.BeforeCookieCollectionChange() +8981612
       System.Web.HttpCookieCollection.Remove(String name) +24
       Telerik.Sitefinity.Security.SecurityManager.DeleteCookie(String cookieName, String path, String domain, Boolean requireSsl) +415
       Telerik.Sitefinity.Security.SecurityManager.UpdateCookies(HttpContextBase context) +390
       Telerik.Sitefinity.Web.SitefinityHttpModule.Context_EndRequest(Object sender, EventArgs e) +82
       System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
1 posts, 0 answered