Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Session state has created a session id, but cannot save it because the response was already flushed by the application (http://www.velocityreviews.com/forums/t301530-session-state-has-created-a-session-id-but-cannot-save-it-because-the-response-was-already-flushed-by-the-application.html)

ganeshd@gmail.com 07-06-2006 03:32 PM

Session state has created a session id, but cannot save it because the response was already flushed by the application
 
Hi,

I've just upgraded my app from ASP.NET 1.1 to 2.0 and am sporadically
seeing this error:

Session state has created a session id, but cannot save it because the
response was already flushed by the application


I use Response.Flush() in my appplication and also have a session
variable in my Session_Start event, but I've never seen this error
before in 1.1. Can someone tell me if the Response.Flush behavior has
changed in 2.0, and if yes, how I can work around this error in 2.0?

Thanks in advance.

Cheers,
Ganesh.


=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?= 07-06-2006 04:41 PM

RE: Session state has created a session id, but cannot save it because
 
I would not recommend attempting to create Session items in the Session_Start
handler. In ASP.NET 2.0, a session does not become alive until you add an
item to it, and attempting to do so in Session_Start is a "catch-22"
situation.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




"ganeshd@gmail.com" wrote:

> Hi,
>
> I've just upgraded my app from ASP.NET 1.1 to 2.0 and am sporadically
> seeing this error:
>
> Session state has created a session id, but cannot save it because the
> response was already flushed by the application
>
>
> I use Response.Flush() in my appplication and also have a session
> variable in my Session_Start event, but I've never seen this error
> before in 1.1. Can someone tell me if the Response.Flush behavior has
> changed in 2.0, and if yes, how I can work around this error in 2.0?
>
> Thanks in advance.
>
> Cheers,
> Ganesh.
>
>


Bruce Barker 07-07-2006 05:39 AM

Re: Session state has created a session id, but cannot save it because the response was already flushed by the application
 
session state id is stored in a cookie. the cookie is a header, and must be
written before any content. if you do a flush, no headers can be written. in
1.1 if buffering was on (the default), flushes were not honored.

-- bruce (sqlwork.com)

<ganeshd@gmail.com> wrote in message
news:1152199924.329213.59590@m73g2000cwd.googlegro ups.com...
> Hi,
>
> I've just upgraded my app from ASP.NET 1.1 to 2.0 and am sporadically
> seeing this error:
>
> Session state has created a session id, but cannot save it because the
> response was already flushed by the application
>
>
> I use Response.Flush() in my appplication and also have a session
> variable in my Session_Start event, but I've never seen this error
> before in 1.1. Can someone tell me if the Response.Flush behavior has
> changed in 2.0, and if yes, how I can work around this error in 2.0?
>
> Thanks in advance.
>
> Cheers,
> Ganesh.
>




zz78_gang 08-17-2007 04:33 AM

I met the same problem in my website
 
I soloved it by create a non-useful session in page_load event.
So, Session has available before Response.Flush().


http://inn.city366.com/


All times are GMT. The time now is 02:54 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.