1

I have deployed a web application on IIS. Its working perfectly on local host but when I deploy it at the IIS it kills the session before going to the next page.

here is my web.config

<system.web>
    <compilation debug="true" targetFramework="4.0"/>
    <sessionState timeout="60"  />
</system.web>

How can I prevent IIS from kill the session?

Erik Schierboom
  • 16,301
  • 10
  • 64
  • 81
user2504141
  • 67
  • 3
  • 11
  • The [session state timeout](http://msdn.microsoft.com/en-us/library/system.web.sessionstate.httpsessionstate.timeout.aspx) just says that a single session will expire in the specified number of minutes, 60 in your case. Does it happen on all pages? Perhaps the session cookie cannot be written? – Erik Schierboom Jun 21 '13 at 14:43
  • yes, this happen for every page – user2504141 Jun 21 '13 at 14:45
  • 1
    Is the site load balanced across multiple servers? – mbeckish Jun 21 '13 at 14:48
  • ah this is the problem.. Site is balanced and session is not! this causes random session exiring.. session exists just in the server that generates it! – Emanuele Greco Jun 21 '13 at 15:29
  • Since this got closed on you I can't post it as an answer, but see http://blogs.msdn.com/b/httpcontext/archive/2012/06/22/shared-session-state-in-a-iis6-and-iis7-web-farm.aspx – JamieSee Jun 21 '13 at 16:11

0 Answers0