网站发布后,有时候就会出现问题
Session state has created a session id, but cannot save it because the response was already flushed by the application
System.Web.SessionState.SessionIDManager.SaveSessi onID(HttpContext context, String id, Boolean& redirected, Boolean& cookieAdded)
at System.Web.SessionState.SessionStateModule.CreateS essionId()
at System.Web.SessionState.SessionStateModule.Delayed GetSessionId()
at System.Web.SessionState.SessionStateModule.OnRelea seState(Object source, EventArgs eventArgs)
at System.Web.SessionState.SessionStateModule.OnEndRe quest(Object source, EventArgs eventArgs)
at System.Web.HttpApplication.SyncEventExecutionStep. System.Web.HttpApplication.IExecutionStep.Execute( )
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously)
没有找到好的解决办法,请遇到过此错误或知道如何解决的人帮助。。。。谢谢
能不能贴你写SESSION的代码出来啊,你有没有用到Response.Flush()这个方法?
在 Page_Load 事件中建一个没有用的Session 试试。
见下面链接
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
我想应该是在Session保存之前Response被Flush了!
在调用Response.Flush()后马上调用Response.End();这样请求就不会继续执行了,如果是下载文件flush之后也就没有必要再执行了
不要使用Response.Flush();使用Response.End()试试
看看下面的文章:
http://bytes.com/groups/net-asp/509183-session-state-has-created-session-id-but-cannot-save-because-response-already-flushed-application