Home
TeamSite
Logging off inactive users who connect via a web page
Phead2
Making a website for interfacing with mediabin, I'm storing the the MBPNetModel.MediaBinServer session as a session state variable for use while the user is on the site.
Everything is working fine, the user gets logged off of mediabin when using a logoff button on the page which calls the MBPNetModel.MediaBinServer.Logoff method but if the user simply closes the window or leaves the page open without using it it takes awhile for the user to get logged out although the user will get logged out eventually.
What is controlling the inactivity time period for the user getting logged out automatically? IIS is set to close connections at 120 seconds, I have the session state set to expire in 5 minutes but it takes longer than this (~21 minutes) for the logout to occur...
Using 4.5 SP 2 if it matters...
Find more posts tagged with
Comments
Migrateduser
If you look at the standard MediaBin web client's global.asa file, in the function Session_OnEnd, you'll notice the web client explicitly logs off when the ASP runtime calls it. This occurs when the session times out.
I'm not familiar with .NET, but I'm assuming you need to add something similar to your web page. The 21 minutes you're observing could be an obscure "feature" of IIS. If a web app is idle for about 20 minutes (idle meaning no active sessions), IIS automatically unloads any loaded dlls. I believe this may be configurable via IIS's metabase or somewhere in the registry, but I'm not entirely sure. When the client-side dlls are unloaded, the tcp/ip connection to the server is broken, which causes any user sessions from that web server, to be terminated.
Phead2
I realized it ends at 20 minutes when the worker process shuts down (which defaults to after 20 minutes of inactivity)...
Having the web app take care of it as you suggested (Session_End in global.asax in asp.net) took care of it, thanks.