Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Session state has created a session id, but cannot save it because the response was already flushed by the application

Reply
Thread Tools

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

 
 
ganeshd@gmail.com
Guest
Posts: n/a
 
      07-06-2006
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.

 
Reply With Quote
 
 
 
 
=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
Guest
Posts: n/a
 
      07-06-2006
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




"" 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.
>
>

 
Reply With Quote
 
 
 
 
Bruce Barker
Guest
Posts: n/a
 
      07-07-2006
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)

<> wrote in message
news: 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.
>



 
Reply With Quote
 
zz78_gang zz78_gang is offline
Junior Member
Join Date: Aug 2007
Posts: 1
 
      08-17-2007
I soloved it by create a non-useful session in page_load event.
So, Session has available before Response.Flush().


http://inn.city366.com/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IllegalStateException: Current state = FLUSHED, new state = CODING Stewart Java 4 05-13-2009 10:38 PM
Cannot share a drive, because already shared? LoWang Windows 64bit 5 03-25-2008 12:19 AM
Servlet.service() for servlet jsp threw exception java.lang.IllegalStateException: getOutputStream() has already been called for this response javadev Java 5 11-16-2006 11:22 AM
HttpError "Session state has created a session id..." PL ASP .Net 2 11-10-2005 04:25 PM
I have created a website "lookup" i dont think its gonna get bigger and fancyer than it already is but have a look Rahmi Acar C++ 0 04-20-2004 10:18 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57