469,943 Members | 2,674 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,943 developers. It's quick & easy.

Cannot modify cookies after HTTP headers have been sent

Hi,

I am going crazy. We get a hundred or so of these errors each day and
while the fix would seem obvious, the error does not include a line
number!

--------------------
Process information:
Process ID: 10084
Process name: w3wp.exe

Exception information:
Exception type: HttpException
Exception message: Server cannot modify cookies after HTTP headers
have been sent.

Request information:
Is authenticated: True
Authentication Type: Forms

Thread information:
Thread ID: 15
Is impersonating: False
Stack trace: at System.Web.HttpCookieCollection.Add(HttpCookie
cookie)
at
System.Web.Security.FormsAuthenticationModule.OnAu thenticate(FormsAuthenticationEventArgs
e)
at System.Web.Security.FormsAuthenticationModule.OnEn ter(Object
source, EventArgs eventArgs)
at
System.Web.HttpApplication.SyncEventExecutionStep. System.Web.HttpApplication.IExecutionStep.Execute( )
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step,
Boolean& completedSynchronously)
--------------------
According to the logs, it doesn't matter what browser they are using,
we've had errors from FF, IE6 and IE7, (and AOL users with each of
those browsers as well) The only common thing is if I scanned the
errors properly, they all use XP (NT 5.1) ...but that's not too
surprising.

Any ideas would be EXCELLENT as some users are having issues logging
into the site and I believe these errors to be the culprit.

Thankyou.

May 10 '07 #1
5 11250
the cookie is a header, so asp.net raises an error if you change it
after the headers have been sent (as it will have no effect). you have a
page with buffering turned off.

-- bruce (sqlwork.com)

gi****@gmail.com wrote:
Hi,

I am going crazy. We get a hundred or so of these errors each day and
while the fix would seem obvious, the error does not include a line
number!

--------------------
Process information:
Process ID: 10084
Process name: w3wp.exe

Exception information:
Exception type: HttpException
Exception message: Server cannot modify cookies after HTTP headers
have been sent.

Request information:
Is authenticated: True
Authentication Type: Forms

Thread information:
Thread ID: 15
Is impersonating: False
Stack trace: at System.Web.HttpCookieCollection.Add(HttpCookie
cookie)
at
System.Web.Security.FormsAuthenticationModule.OnAu thenticate(FormsAuthenticationEventArgs
e)
at System.Web.Security.FormsAuthenticationModule.OnEn ter(Object
source, EventArgs eventArgs)
at
System.Web.HttpApplication.SyncEventExecutionStep. System.Web.HttpApplication.IExecutionStep.Execute( )
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step,
Boolean& completedSynchronously)
--------------------
According to the logs, it doesn't matter what browser they are using,
we've had errors from FF, IE6 and IE7, (and AOL users with each of
those browsers as well) The only common thing is if I scanned the
errors properly, they all use XP (NT 5.1) ...but that's not too
surprising.

Any ideas would be EXCELLENT as some users are having issues logging
into the site and I believe these errors to be the culprit.

Thankyou.
May 10 '07 #2
I actually believe this issue was resolved by renaming the forms
authentication name in the web.config. I believe during the update
from 1.1 to 2.0 the cookie encryption changed, and since the old
cookie was unable to be read, it couldn't be cleared and recreated the
2.0 way...this renaming seems to have solved the error.

Thankyou though.

On May 10, 10:59 am, bruce barker <nos...@nospam.comwrote:
the cookie is a header, so asp.net raises an error if you change it
after the headers have been sent (as it will have no effect). you have a
page with buffering turned off.

-- bruce (sqlwork.com)

gib...@gmail.com wrote:
Hi,
I am going crazy. We get a hundred or so of these errors each day and
while the fix would seem obvious, the error does not include a line
number!
--------------------
Process information:
Process ID: 10084
Process name: w3wp.exe
Exception information:
Exception type: HttpException
Exception message: Server cannot modify cookies after HTTP headers
have been sent.
Request information:
Is authenticated: True
Authentication Type: Forms
Thread information:
Thread ID: 15
Is impersonating: False
Stack trace: at System.Web.HttpCookieCollection.Add(HttpCookie
cookie)
at
System.Web.Security.FormsAuthenticationModule.OnAu thenticate(FormsAuthenticationEventArgs
e)
at System.Web.Security.FormsAuthenticationModule.OnEn ter(Object
source, EventArgs eventArgs)
at
System.Web.HttpApplication.SyncEventExecutionStep. System.Web.HttpApplication.IExecutionStep.Execute( )
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step,
Boolean& completedSynchronously)
--------------------
According to the logs, it doesn't matter what browser they are using,
we've had errors from FF, IE6 and IE7, (and AOL users with each of
those browsers as well) The only common thing is if I scanned the
errors properly, they all use XP (NT 5.1) ...but that's not too
surprising.
Any ideas would be EXCELLENT as some users are having issues logging
into the site and I believe these errors to be the culprit.
Thankyou.

May 10 '07 #3
Apparently, it stopped some of the errors...the once that I got by
email. But some users are still experiencing the problem and the
error shows up in their browser...not caught by our error handling for
some reason.

The one thing I've noticed from the user who intermittently
experiences the error here is that it only happens when clicking on a
link to the site from an email.

On May 10, 11:50 am, Gibble <gib...@gmail.comwrote:
I actually believe this issue was resolved by renaming the forms
authentication name in the web.config. I believe during the update
from 1.1 to 2.0 the cookie encryption changed, and since the old
cookie was unable to be read, it couldn't be cleared and recreated the
2.0 way...this renaming seems to have solved the error.

Thankyou though.

On May 10, 10:59 am, bruce barker <nos...@nospam.comwrote:
the cookie is a header, so asp.net raises an error if you change it
after the headers have been sent (as it will have no effect). you have a
page with buffering turned off.
-- bruce (sqlwork.com)
gib...@gmail.com wrote:
Hi,
I am going crazy. We get a hundred or so of these errors each day and
while the fix would seem obvious, the error does not include a line
number!
--------------------
Process information:
Process ID: 10084
Process name: w3wp.exe
Exception information:
Exception type: HttpException
Exception message: Server cannot modify cookies after HTTP headers
have been sent.
Request information:
Is authenticated: True
Authentication Type: Forms
Thread information:
Thread ID: 15
Is impersonating: False
Stack trace: at System.Web.HttpCookieCollection.Add(HttpCookie
cookie)
at
System.Web.Security.FormsAuthenticationModule.OnAu thenticate(FormsAuthenticationEventArgs
e)
at System.Web.Security.FormsAuthenticationModule.OnEn ter(Object
source, EventArgs eventArgs)
at
System.Web.HttpApplication.SyncEventExecutionStep. System.Web.HttpApplication.IExecutionStep.Execute( )
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step,
Boolean& completedSynchronously)
--------------------
According to the logs, it doesn't matter what browser they are using,
we've had errors from FF, IE6 and IE7, (and AOL users with each of
those browsers as well) The only common thing is if I scanned the
errors properly, they all use XP (NT 5.1) ...but that's not too
surprising.
Any ideas would be EXCELLENT as some users are having issues logging
into the site and I believe these errors to be the culprit.
Thankyou.

May 10 '07 #4
I stand corrected, I still get errors in my email...just not as many
it seems.

I thought I read somewhere, that it could be something to do with the
session timeout vs the forms authentication cookie timeout?

On May 10, 12:58 pm, Gibble <gib...@gmail.comwrote:
Apparently, it stopped some of the errors...the once that I got by
email. But some users are still experiencing the problem and the
error shows up in their browser...not caught by our error handling for
some reason.

The one thing I've noticed from the user who intermittently
experiences the error here is that it only happens when clicking on a
link to the site from an email.

On May 10, 11:50 am, Gibble <gib...@gmail.comwrote:
I actually believe this issue was resolved by renaming the forms
authentication name in the web.config. I believe during the update
from 1.1 to 2.0 the cookie encryption changed, and since the old
cookie was unable to be read, it couldn't be cleared and recreated the
2.0 way...this renaming seems to have solved the error.
Thankyou though.
On May 10, 10:59 am, bruce barker <nos...@nospam.comwrote:
the cookie is a header, so asp.net raises an error if you change it
after the headers have been sent (as it will have no effect). you have a
page with buffering turned off.
-- bruce (sqlwork.com)
gib...@gmail.com wrote:
Hi,
I am going crazy. We get a hundred or so of these errors each day and
while the fix would seem obvious, the error does not include a line
number!
--------------------
Process information:
Process ID: 10084
Process name: w3wp.exe
Exception information:
Exception type: HttpException
Exception message: Server cannot modify cookies after HTTP headers
have been sent.
Request information:
Is authenticated: True
Authentication Type: Forms
Thread information:
Thread ID: 15
Is impersonating: False
Stack trace: at System.Web.HttpCookieCollection.Add(HttpCookie
cookie)
at
System.Web.Security.FormsAuthenticationModule.OnAu thenticate(FormsAuthenticationEventArgs
e)
at System.Web.Security.FormsAuthenticationModule.OnEn ter(Object
source, EventArgs eventArgs)
at
System.Web.HttpApplication.SyncEventExecutionStep. System.Web.HttpApplication.IExecutionStep.Execute( )
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step,
Boolean& completedSynchronously)
--------------------
According to the logs, it doesn't matter what browser they are using,
we've had errors from FF, IE6 and IE7, (and AOL users with each of
those browsers as well) The only common thing is if I scanned the
errors properly, they all use XP (NT 5.1) ...but that's not too
surprising.
Any ideas would be EXCELLENT as some users are having issues logging
into the site and I believe these errors to be the culprit.
Thankyou.

May 10 '07 #5
I don't know what page it could be that would have buffering turned
off.

I don't get a line number for where the error occurs...and the site is
over a dozen projects, with 100s of classes in each...the culprit
could be anywhere if it was buffering...

The thing that really bothers me, is this problem wasn't happening
in .NET 1.1, but does in .NET 2.0...and several other issues we've had
that looked like one thing, have turned out to be something else,
related to fundamental changes in defaults/logic/BUGS between 1.1 and
2.0.

I'm going crazy here :-o

On May 10, 10:59 am, bruce barker <nos...@nospam.comwrote:
the cookie is a header, so asp.net raises an error if you change it
after the headers have been sent (as it will have no effect). you have a
page with buffering turned off.

-- bruce (sqlwork.com)

gib...@gmail.com wrote:
Hi,
I am going crazy. We get a hundred or so of these errors each day and
while the fix would seem obvious, the error does not include a line
number!
--------------------
Process information:
Process ID: 10084
Process name: w3wp.exe
Exception information:
Exception type: HttpException
Exception message: Server cannot modify cookies after HTTP headers
have been sent.
Request information:
Is authenticated: True
Authentication Type: Forms
Thread information:
Thread ID: 15
Is impersonating: False
Stack trace: at System.Web.HttpCookieCollection.Add(HttpCookie
cookie)
at
System.Web.Security.FormsAuthenticationModule.OnAu thenticate(FormsAuthenticationEventArgs
e)
at System.Web.Security.FormsAuthenticationModule.OnEn ter(Object
source, EventArgs eventArgs)
at
System.Web.HttpApplication.SyncEventExecutionStep. System.Web.HttpApplication.IExecutionStep.Execute( )
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step,
Boolean& completedSynchronously)
--------------------
According to the logs, it doesn't matter what browser they are using,
we've had errors from FF, IE6 and IE7, (and AOL users with each of
those browsers as well) The only common thing is if I scanned the
errors properly, they all use XP (NT 5.1) ...but that's not too
surprising.
Any ideas would be EXCELLENT as some users are having issues logging
into the site and I believe these errors to be the culprit.
Thankyou.

May 10 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Robert Scheer | last post: by
4 posts views Thread by Tom Jones | last post: by
8 posts views Thread by Andreas Klemt | last post: by
2 posts views Thread by john.lehmann | last post: by
8 posts views Thread by mcserret | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.