locked
Session variables RRS feed

  • Question

  • User124127460 posted

    Hi Team,

    I have asp.net 2.0 C# website. I have a tab on the site ,onclick of it a popup is opened (via javascript) which opens a new site (interface), this opens fine 1st time,

    Now when I close that popup and re click the tab i get an error saying object set to null value, and the line where it gives an error is it tries to fetch a session variable (object) where all the userdetails are stored. 

    So I guess the sessions info is not getting retrvied, any pointers on this.  This is happening on IIS 7, windows server 2008 r2 64 bit. I have enabled 32 bit in IIS.

    Our old site is on windows server 2003 r2, iis 6, we are migrating.

    Friday, July 24, 2015 2:51 AM

All replies

  • User541108374 posted

    Hi,

    when you debug your application can you check if the session is still there and holds the information you expect?

    Grz, Kris.

    Friday, July 24, 2015 2:59 AM
  • User124127460 posted

    I cant debug the applications on the server. It works fine on my local machine

    Friday, July 24, 2015 3:12 AM
  • User541108374 posted

    Hi,

    I cant debug the applications on the server

    You can make use of Remote debugging.

    An other way would be to response write the content of the session state (for debugging purposes, make sure you turn it off before moving to production!).

    Grz, Kris.

    Friday, July 24, 2015 3:25 AM
  • User124127460 posted

    By debugging  i will know its Null. but why is coming as null , my below line:

    session["UserInfo"] is null , this works fine on iis 6 windows server 2003

    Friday, July 24, 2015 3:31 AM
  • User541108374 posted

    Hi,

    this works fine on iis 6 windows server 2003

    In which mode does the IIS 7 app run? Integrated or Classic? Check this document for migration and session state: https://msdn.microsoft.com/en-us/library/bb515251(v=vs.140).aspx.

    Grz, Kris.

    Friday, July 24, 2015 3:40 AM
  • User124127460 posted

    I have IIS 7.5 , its running on classic mode ... Enable 32 bit applications is set to true

    Friday, July 24, 2015 5:22 AM
  • User541108374 posted

    Hi,

    did you try integrated mode already? If not then do so.

    I have IIS 7.5

    In your original post you stated you had IIS 7. Such details are important.

    Grz, Kris.

    Friday, July 24, 2015 5:48 AM
  • User-481631678 posted

    Generally such behavior occurs when you are writing some file in the same folder where your application is hosted. Any change in content of the application folder causes IIS to restart and you can loose your session.

    Thursday, August 6, 2015 7:55 AM