473,763 Members | 4,584 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.

Jul 6 '06 #1
2 6641
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


"ga*****@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.

Jul 6 '06 #2
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)

<ga*****@gmail. comwrote in message
news:11******** *************@m 73g2000cwd.goog legroups.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.

Jul 7 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
3023
by: Seth | last post by:
I have noticed that the id of my session object changes when I switch from a non-secure to a secure connection. What I'm trying to do: I have a cookie that is built on the non-secure side of things. What I need to do is to switch to a secure connection and then later on while still in that secure connection delete the cookie that was created on the non- secure side. I need to do this because I can not reference the non-secure cookie...
3
2013
by: grooby | last post by:
I would like to develop an asp.net Web application using muliple web projects under one solution file and share the session information between web applications( or projects). Is this possible?
3
3444
by: Mark | last post by:
Ok, I know that .net inherently does not share session data across asp.net projects, but is there any decent work around to this. We already have a big chunk of our application using the asp.net session object (using state service). I'd like to start breaking out our functionality into component projects, but I'd like to get this session issue worked out first. Any ideas?? I found this article , but it sounds like kind of a pain.
5
2200
by: ASP.Confused | last post by:
As you can tell from my previous posts on this issue...I'm really confused :-/ I have a few ASP.NET web applications on my web host's "https" server. Our web host has a single "bin" folder for me to toss my assemblies into. We keep loosing session state every few months. People have told me that my app could be running out of memory, causing the sessions to get reset. Well, if this is the case, then when I go to the page again,...
9
9780
by: charliewest | last post by:
Hello - I have images saved in my SQL SERVER 2000 database. Using ASP.NET (C#) is there any way to temporarily save an image to a session object, and after running some other operations, later retrieve the image from the session object, convert it back to an image, and re-save it to the database? Thanks?
9
5314
by: McGeeky | last post by:
Is there a way to get a user control to remember its state across pages? I have a standard page layout I use with a header and footer as user controls. Each page uses the same layout by means of copy paste (I hear this will improve in ASP.Net 2 via master pages). When I navigate from one page to the next the header and footer user controls lose their state because they are effectively different instances of the user control. Is there...
2
3157
by: PL | last post by:
I've seen a few of these in the eventlog, what in the world would cause something like this, why can't it save the session id cookie ?? Exception type: HttpException Exception message: Session state has created a session id, but cannot save it because the response was already flushed by the application. System.Web.SessionState.SessionIDManager.SaveSessionID(HttpContext context, String id, Boolean& redirected, Boolean& cookieAdded) at...
5
548
by: Sean | last post by:
Problem with sessions I have created an application without concern for sessions. As it turns out I think that might be my undoing. What I have: I have an online quiz. I don’t need to know users or save any data. If the application crashes or user exits the program they should simply start again. Pretty basic. All interactions are stored in an array (not much going on to save to a
1
1641
by: suvarna1026 | last post by:
Can any one plz tell me why I am getting this error,and what is the meaning of this error--- Session state has created a session id, but cannot save it because the response was already flushed by the application.
0
9386
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10144
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9997
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8821
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7366
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3522
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.