Click here to Skip to main content
15,917,991 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I write a following code in web.config file to increased a timeout of session
XML
<sessionstate mode="InProc" timeout="120"/>

but it is not work most of time.
After uploading website on server it is not at all work.
I search of internet but it seen that it is a problem generally occurred with session mode="InProc" please help.

What I have tried:

I write a following code in web.config file to increased a timeout of session
XML
<sessionstate mode="InProc" timeout="120"/>
Posted
Updated 27-Jun-16 8:36am
v2
Comments
Kornfeld Eliyahu Peter 27-Jun-16 9:48am    
How do you know it is not working? You have waited there for two hours and more to check?
Kishor-KW 27-Jun-16 9:54am    
yes i did BTW session is out after 15 mint. instead i gave time of 2 hour
TheKarateKid 27-Jun-16 10:14am    
is there any way that you have session setting in IIS which is less than 120 ?
[no name] 27-Jun-16 10:43am    
http://stackoverflow.com/questions/1205828/how-to-set-session-timeout-in-web-config
ZurdoDev 27-Jun-16 11:32am    
Some things that may be affecting it. Your idle timeout on the app pool in IIS may be causing it. If you have code that is changing web.config your sessions will get reset. If you are putting new code in place you'll also lose your sessions.

1 solution

As mentioned in the comments, there are several things that can cause sessions to get lost. Your idle timeout on the app pool in IIS may be causing it. If you have code that is changing web.config your sessions will get reset. If you are putting new code in place you'll also lose your sessions.

You'll need to troubleshoot why your session is getting reset. I'd also like to hear why you think the session is being reset.
 
Share this answer
 
Comments
Kishor-KW 30-Jun-16 7:14am    
but what is role of IIS after hosting web-site on other server. IIS is a Local server am I right?
ZurdoDev 30-Jun-16 8:16am    
What role? I'm not sure what you are asking.
Kishor-KW 30-Jun-16 9:24am    
i mean there is no iis server at hosted server. IIS server is one on which we run our website developed in Visual studio. Is IIS server like wamp server ?
ZurdoDev 30-Jun-16 10:13am    
If your hoster does not have IIS, how are they hosting your site? You need IIS to host ASP.Net sites.
Kishor-KW 30-Jun-16 13:17pm    
okk.Thank you for sort out my confusion. So I have to contact to my hoster to changes settiong of IIS to increase time of session

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900