This is a migrated thread and some comments may be shown as answers.

"Server cannot modify cookies after HTTP headers have been sent."

2 Answers 536 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Rory
Top achievements
Rank 1
Rory asked on 29 May 2008, 10:41 PM
Hi there,
I'm using custom providers to get and set cookies. This has worked fine up to the latest AjaxManager and AjaxPanel. With the latest If we try updating our cookie collection on an AjaxRequest we get this error below. Does anyone know of a workaround for this issue? I've tried this .config setting but no luck so far. Thanks for any help.

Setting we tried:
<roleManager enabled="true" defaultProvider="WebServiceProvider" cacheRolesInCookie="false">
 
"Server cannot modify cookies after HTTP headers have been sent."

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 30 May 2008, 09:43 AM
Hi Rory,

I found a link which discusses a similar error. Go through the following link.
http://www.sitefinity.com/support/forums/support-forum-thread/b1043S-bdbtmm.aspx

Princy.
0
Rory
Top achievements
Rank 1
answered on 17 Jun 2008, 09:43 PM
Hello, I believe I got this error to go away. This went away when I set this value in the Page Header. We were adding Cookies to the Response during an Ajax call and now the error went away. Yea!
<%@  Page  EnableEventValidation="false"

This error seems to be similar or the same as this error:

Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.





Tags
Ajax
Asked by
Rory
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Rory
Top achievements
Rank 1
Share this question
or