Tuesday, August 17, 2010

Please help me about ASP .NET 2.0 session variables...?

Hi, and thank you about your attention to my question.





I have developed a web site using .NET framework 2.0 and upload it on a free hosting package provided by www.somee.com.





I had use a session variable which takes boolean values. I defined that like this in session onstart event in global.asax.





Session.Add["MyVar",false];





And I set this session variable in other side of my process.





But when I refresh the page which gets the session variable value, after a few tries the session variable loses it's value and I encounter to starting point. I don't change the value of that variable in to false anywhere in my application.





And let me mention that I didn't face this problem while I was debugging the website on my own pc (localhost).





Is there any block set which I should define or modify in Web.Config, if so what is that, and if not what can I do?





Be Succeed,


Babax.

Please help me about ASP .NET 2.0 session variables...?
Session variables only last 20min with default settings. You can adjust theses settings in your Web.Config file the server you are hosting on may have settings that override this or not enough memory reserved/available to maintain this. You may be able to accomplish what you need using a browser cookie or maintaining the information in a database.


No comments:

Post a Comment