Session value expires too quickly in hosting environment.How to fix this in asp.net
You can't do anything about session lifetime, as even if you change that property in the web.config
the hosting machine configuration file will always prevail on that, and if they have 5 minutes, no matter if you have 60 minutes in your web.config
the session live span will always be 5 minutes.
What you can do is change to SQL Session State and it's only there where you have total control on your session live span, but there are advantages and disadvantages on using this.
Or you can avoid the session all together by using the Cache System.
Unfortunaly this happens to much on Shared hosting, and keep in mind that the session will reset every time your application pool refreshes and this happens much more frequently in shared hosting.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With