Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Session state created while response flushed....

Session state created while response flushed....

Scheduled Pinned Locked Moved ASP.NET
helpdebuggingquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kasic Slobodan
    wrote on last edited by
    #1

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

    I have a big problem with this error. Few days ago, web app worked fine and when session expired and I refreshed the page, code inside Session_Start in global.asax logs me in again.

                cookie = Request.Cookies\["Userword"\];
                
                if (cookie != null)
                {
                    string strCookie = cookie.Value;
    
                    if (strCookie != "")
                    {
                        sin.AutoLogin(cookie.Values\["heavy"\],
                            cookie.Values\["metal"\],
                            true, Request.UrlReferrer.AbsoluteUri == null ? "" : Request.UrlReferrer.AbsoluteUri, false);
    
                    }
                }
                else
                {
                    if (Session\["UserInfo"\] == null)
                    {
                        Response.Redirect("login.aspx");
                    }
                }
    

    Yesterday I can't login by refreshing the page, any more. If I login manually, everything is ok. Error raises only when session expires and user refreshes the page. When I try to step in AutoLogin function, try catch block catches the Object reference error before debugger was able to step into a function. The above error I caught in Application_Error in global.asax. I have searched the net for solution, but with no luck. Most of the answers were that you shouldn't use Response.Flush and I have Response.Flush only in captcha class which is loaded on login.aspx page and everything worked great until yesterday. Can anyone help me with this issue?

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups