ASP.net Sessions Dropping
-
Helllo, I have an app that seems to create a new session randomly when selecting between pages (I view the Session.IsNewSession variable to check.) My understanding is that the only way a session can end and start again is if the browser is closed, or the user reaches the SessionState timeout value. Has anyone else seen this, and do you have any ideas? Thanks, Ken
-
Helllo, I have an app that seems to create a new session randomly when selecting between pages (I view the Session.IsNewSession variable to check.) My understanding is that the only way a session can end and start again is if the browser is closed, or the user reaches the SessionState timeout value. Has anyone else seen this, and do you have any ideas? Thanks, Ken
How about Session.Abandon() VB,ASP, C#, ASP.NET, VB.NET, Oracle, SQL Server. -------------------------------------------------- Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." - Albert Einstein (1879-1955) "C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup
-
Helllo, I have an app that seems to create a new session randomly when selecting between pages (I view the Session.IsNewSession variable to check.) My understanding is that the only way a session can end and start again is if the browser is closed, or the user reaches the SessionState timeout value. Has anyone else seen this, and do you have any ideas? Thanks, Ken
Hi Ken, Sessions also can be dropped when the AppDomain is recycled, which can happen quite often in ASP.NET if you don't have enough RAM in your server. Check your event logs to be certain of what is happening. If it is AppDomains being recycled, the easiest solution is to add RAM, but if that's not an option for you, you can increase the process recycling threshold in your machine.config file. Marcie CP Blog[^]
-
Helllo, I have an app that seems to create a new session randomly when selecting between pages (I view the Session.IsNewSession variable to check.) My understanding is that the only way a session can end and start again is if the browser is closed, or the user reaches the SessionState timeout value. Has anyone else seen this, and do you have any ideas? Thanks, Ken
Are you in a web farm, by any chance? If so, check the sticky option settings of the load balancer [most, but not all, have them.] If the sticky bit is not set, the user will be bounced from server to server at the whim of the load balancer. In my experience, the user will have a new Session generated each time they move from one server to another, even if they've been there recently. Hope that helps. :) --Jesse
-
Hi Ken, Sessions also can be dropped when the AppDomain is recycled, which can happen quite often in ASP.NET if you don't have enough RAM in your server. Check your event logs to be certain of what is happening. If it is AppDomains being recycled, the easiest solution is to add RAM, but if that's not an option for you, you can increase the process recycling threshold in your machine.config file. Marcie CP Blog[^]
Thanks for the response. Hmmmm, I have no control over the server since it's with a host. Hopefully it's not the case that the server is the problem, or I'll need to find a new host. I'll try a few simple tests to see if I can easily repoduce the problem. Thanks again, Ken
-
Are you in a web farm, by any chance? If so, check the sticky option settings of the load balancer [most, but not all, have them.] If the sticky bit is not set, the user will be bounced from server to server at the whim of the load balancer. In my experience, the user will have a new Session generated each time they move from one server to another, even if they've been there recently. Hope that helps. :) --Jesse
Thanks Jesse; that helps and does make sense. It's looking like the problem is on the server which is hosted somewhere else. Ken
-
Are you in a web farm, by any chance? If so, check the sticky option settings of the load balancer [most, but not all, have them.] If the sticky bit is not set, the user will be bounced from server to server at the whim of the load balancer. In my experience, the user will have a new Session generated each time they move from one server to another, even if they've been there recently. Hope that helps. :) --Jesse
SQL ASPSession table rules!!