locked
IIS Express doesn't keep session data RRS feed

  • Question

  • User318700276 posted
    I have an application that I run in Visual Studio 2013 under IIS Express server. The problem is that session data is not kept between pages and I find with null objects that weren't null the page before. If I compile the application and deploy it on a web server with IIS it works normally, so it must be something with IIS Express. I searched the config files in the
    document folders, but really don't know what it is. The application runs correctly in Visual Studio 2010, which doesn't run IIS Express.

    Thanks,
    Luke
    Friday, November 21, 2014 6:22 AM

Answers

  • User318700276 posted
    I found what it is. Checking the calling urls to the context_BeginRequest method, I found that one was from "browserLink". So the solution is to disable browser link http://www.asp.net/visual-studio/overview/2013/using-browser-link.

    Thanks to stackoverflow.com
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, November 28, 2014 4:32 AM

All replies

  • User-271186128 posted

    Hi Luke,

    From your description, your application work well on IIS, but it doesn't work on IIS Express. I also created a sample using Visual Studio 2013, and tested it on IIS and IIS Experss. They all worked well. So, as you said, the issue is related to the IIS Express, I suggest you could try to reinstall the IIS Express. 

    Please refer to this article.

    http://www.iis.net/learn/extensions/introduction-to-iis-express/iis-express-overview

    Best Regards,
    Dillion

    Monday, November 24, 2014 5:03 AM
  • User318700276 posted

    Hi, I reinstalled IIS Express to the latest version but the problem persists. Session uses session variables. Thanks

    Monday, November 24, 2014 8:50 AM
  • User-271186128 posted

    Hi Luke,

    I suggest you could create a new project to check it.

    Best Regards,
    Dillion

    Tuesday, November 25, 2014 7:16 AM
  • User318700276 posted
    I'm debugging the code on the same machine witn VS 2013 and VS 2010 and I found where the code behaves differently. After the code behind has been executed and the page has been built, in VS 2010 the execution ends. In VS 2013 after the page has been built I get another call to the method context_BeginRequest(object sender, EventArgs e), which redirects the application to the
    starting page, where the instruction Session.Clear() clears the session. The problem now is: why is there this additional call to context_BeginRequest method? Why does it redirect to the starting page and not to the page it is currently in? Thanks, Luke.
    Tuesday, November 25, 2014 10:32 AM
  • User318700276 posted
    I found what it is. Checking the calling urls to the context_BeginRequest method, I found that one was from "browserLink". So the solution is to disable browser link http://www.asp.net/visual-studio/overview/2013/using-browser-link.

    Thanks to stackoverflow.com
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, November 28, 2014 4:32 AM