Last post Apr 21, 2011 08:06 AM by sirdneo
Apr 15, 2011 11:23 AM|nabeelfaruqui|LINK
A very simple question... i want a debate on this issue
Wheever we change the aspx or ascx file in development environment, then Session (Asp.Net Session) expires automatically, when we try to reload the page to see our changes. This reduces the efficiency of development. Is there any way to avoid this.
Do let us know what is the reason for session expiration
Apr 15, 2011 12:45 PM|kryptonkal|LINK
I also experience that same problem, but not regularly. From what I understand; whenever you change code within a class, you would have to recompile the application, but if the changes were made to the html (design element) page then you would not have
to recompile as a simple ctrl-f5 would suffice.
Think of it from a traditional application perspective: how would changes made to a class be included in the executable if the changes were not compiled? Hope this helps. Good luck.
Apr 15, 2011 01:38 PM|nilsan|LINK
Explaination in above post is valid. However could you just make Firefox your default browser and run your page and then change your code, and check out whether session expires?
Apr 15, 2011 01:40 PM|matyvegan|LINK
when u make a change in codebehind or reference code (all code that need to compile) the iis (static o virtual) need to refresh the app web.
when the app web is restart all sessions clear. when u request a page, new session start.
Apr 16, 2011 01:44 AM|shahed.kazi|LINK
Check your Session expiration time. Default is 20 or 30 minutes. You can increase it from within the web.config file.
Apr 19, 2011 05:18 AM|nabeelfaruqui|LINK
I am only talking about HTML Changes. No code chage. Only change HTML of any ASCX control and you will notice that session will expire. I need to know any reason for that. I do understand that some changes require compilation. But i think HTML changes dont
Apr 19, 2011 08:57 AM|emilyjohnson|LINK
You should try you would have to recompilation that application after making changes in the class. Good Luck.
Apr 20, 2011 04:04 AM|Zizhuoye Chen - MSFT|LINK
Base on my experience, change HTML markup of aspx page will not cause the session expire. Commonly, if the application pool recycled or IIS restart can be the case that it will lost session.
By default, Asp.net generate a cookie named ASP.NET sessionid in client which store an unqiue id and every postback it will check on server. So I think you need to make sure both cookie are enabled in your browser and session, cookie timeout setting in your
site or in IIS.
Do all the browser have the same behavior or just one specific do like above?
If you are using IIS 7, there several main settings you may check.
Hope this can help you.
Apr 21, 2011 08:06 AM|sirdneo|LINK
Whenever you change the contents of aspx or ascx files, application is rebuild and IIS unloads the application. If your session mode is set to InProc then you will loose your session (and generally if you hit refresh you will goto login page) which is reducing
To overcome that problem, you can implement StateServer, since state server runs in seperate process so even if your application is restarted due to compilation or contents modification you wont loose your session. For details of implementing state server
readout this post:-