locked
Session state has created a session id, but cannot save it because the response was already flushed by the application - in a wss3.0 site RRS feed

  • Question

  • Dear All,

    I am using wss3.0. In my site randomly shows the following error page during the loggin time. All other times it works fine.

    Server Error in '/' Application.

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

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Web.HttpException: Session state has created a session id, but cannot save it because the response was already flushed by the application.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


    Stack Trace:

    [HttpException (0x80004005): 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) +8557557
    System.Web.SessionState.SessionStateModule.CreateSessionId() +57
    System.Web.SessionState.SessionStateModule.DelayedGetSessionId() +64
    System.Web.SessionState.SessionStateModule.ReleaseStateGetSessionID() +20
    System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs) +536
    System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75



    Version Information: Microsoft .NET Framework Version:2.0.50727.3615; ASP.NET Version:2.0.50727.3618

     

    This error will be disappears on the temporary file clearing. This error will be occurs randomly. So i can't simulate this issue in any test case.

     

    Please help me.

     

    Thanks in advance..

     


    sujithsb
    • Moved by Mike Walsh FIN Thursday, May 5, 2011 10:21 AM Not a programming question so why post it to the programming forum? (From:SharePoint - Development and Programming (pre-SharePoint 2010))
    Thursday, May 5, 2011 9:38 AM

Answers

  • Hello,

    Check for a global.asax file in IIS - see this article for more information:

    http://msdn.microsoft.com/en-us/library/1xaas8a2(v=vs.71).aspx

    If it is there add this code:

    void Session_Start(object sender, EventArgs e)  
    { 
       
    // Code that runs when a new session is started 
       
    string sessionId = Session.SessionID; 
    } 

    That should fix it!

    Thanks!

    Tom

     

     

     


    Tom Molskow - SharePoint Architect - Microsoft Community Contributor 2011 Award - Linked-In - SharePoint Gypsy
    • Marked as answer by David HM Friday, May 13, 2011 1:33 AM
    Thursday, May 5, 2011 6:19 PM

All replies

  • Hello,

    Check for a global.asax file in IIS - see this article for more information:

    http://msdn.microsoft.com/en-us/library/1xaas8a2(v=vs.71).aspx

    If it is there add this code:

    void Session_Start(object sender, EventArgs e)  
    { 
       
    // Code that runs when a new session is started 
       
    string sessionId = Session.SessionID; 
    } 

    That should fix it!

    Thanks!

    Tom

     

     

     


    Tom Molskow - SharePoint Architect - Microsoft Community Contributor 2011 Award - Linked-In - SharePoint Gypsy
    • Marked as answer by David HM Friday, May 13, 2011 1:33 AM
    Thursday, May 5, 2011 6:19 PM
  • Tom, this fixed it for me!  Thank you.

    What perplexes me is why this isn't entered by default when VS 2013 creates a blank web app. with a Global.asax file.  You would think it would be there by default.

    Anyway, easy fix and thanks again.

    JHH

    Monday, January 4, 2016 4:36 PM