2

i am really facing a problem with asp.net web application. i am using sessions and it seems to be fine on my local machine and IIS server.

but on my live server sessions are expiring randomly(5min max up to 30min). i have tried almost all the possibilities but i never win.

please advise me how can i fix my problem.

3 Answers3

0

Did you try from webconfig..

<configuration>
  <system.web>
     <sessionState timeout="20"></sessionState>
  </system.web>
</configuration>
Sasidharan
  • 3,676
  • 3
  • 19
  • 37
  • ya i was tried that to 9999 that's why it is always live on my local machine and on my iis server. Thanks for your reply – user2978907 Nov 11 '13 at 11:34
  • ....Did you try mode.. – Sasidharan Nov 11 '13 at 11:39
  • For further information about session modes...http://msdn.microsoft.com/en-us/library/ms178586.aspx – Sasidharan Nov 11 '13 at 11:40
  • Then from your live server you have to check the session timeout settings which will be in default websites settings.. – Sasidharan Nov 11 '13 at 11:46
  • can you please let me know what exactly it is causing the problem for random expiry. if it is expiring at the same time means that i have to increase. But in this case i don't know what should i do – user2978907 Nov 11 '13 at 11:52
  • Check your code for session.abandon or session overwrite..Mostly these are the causes.. – Sasidharan Nov 11 '13 at 11:53
  • also tried with only one web page and two text boxes, one button and one session. Also doing the same. – user2978907 Nov 11 '13 at 11:55
  • Check http://forums.asp.net/t/1581671.aspx and http://www.c-sharpcorner.com/uploadfile/technoNet/session-timeouts-causes-and-remedies/ – Sasidharan Nov 11 '13 at 11:58
  • Thanks for your advices. I am coming up with the more information what exactly i am doing i think this could be help full to me to solve my problem. – user2978907 Nov 11 '13 at 12:52
  • I am using ftp server to host my web site using filezilla i don't know exactly how much free space i am having on that server. if you give me some instructions to find out the free space on my server means i will check it. – user2978907 Nov 11 '13 at 13:00
  • I am facing the same issue. Did you find any solution? – Prashant Kankhara Aug 24 '16 at 16:52
0

Try to implement log in global.asax on session_end event and set session mode to InProc

void Session_End(object sender, EventArgs e)
    {
        // Code that runs when a session ends. 
        // Note: The Session_End event is raised only when the sessionstate mode
        // is set to InProc in the Web.config file. If session mode is set to StateServer 
        // or SQLServer, the event is not raised.

    }
<configuration>
  <system.web>
     <sessionState mode="InProc" timeout="20"></sessionState>
  </system.web>
</configuration>

so that you can find out the cause which is expiring the session.

Rajesh Kumar
  • 2,443
  • 3
  • 28
  • 43
0

I have also been looking into the same thing and found a similar post that says your app memory may have been recycled due to lack of memory.

random IIS session timeout

Community
  • 1
  • 1
Ishey4
  • 327
  • 3
  • 13