Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > How do I avoid ASP.NET session timeout from a httphandler?

Thread Tools

How do I avoid ASP.NET session timeout from a httphandler?

Posts: n/a

I have a HTTPHandler code that handles file uploads on a ASP.NET
server (IIS 6.0). The code handles large file uploads which can range
from 1K to 500MB. In case of large files, the upload is successful,
but the session times out and we end up taking the user to the login

The machine.config has the following settings:
<httpRuntime maxRequestLength="131072" executionTimeout="36000"/>
<sessionState mode="InProc"
stateConnectionString="tcpip=" stateNetworkTimeout="10"
sqlConnectionString="data source=;Integrated Security=SSPI"
cookieless="false" timeout="20"/>

All the worker process re-cycle options have been disabled.

Some solutions we have tried out:
- In the Httphandler code, while handling the file upload we check for
the session timeout against the HttpApplication.Session.Timeout and if
the upload time is approaching the session timeout we tried to adjust
the HttpApplication.Session.Timeout value expecting the server code to
extend the session, but that does not occur.

- Have a small js code that pings the server every 5 mins. This seems
to work, but in our specific upload page, we have implemented an
activex control which internally uses WinInet to upload, resulting in
usage of max 2 connections. Thus the js with activex control does not
work for us as js code is not able to open a new connection.

- Increase the session timeout on the config file. After some playing
around and tweaking, we realised that 70% of the users have no issues
if we set it to 30 mins, but around 10% of users regularly transfer
50MB and above, and for these people the timeout is irritating. Due to
the load on the servers the OPS guys do not like extending the timeout
period further.

Any suggestions?

thx in advance
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Session Timeout problems-web.confg session state and IIS session s =?Utf-8?B?Um9iSEs=?= ASP .Net 4 04-11-2007 04:52 PM
Timeout::timeout and Socket timeout Mark Probert Ruby 1 10-06-2004 09:30 AM
Session contents lost despite Session.Timeout = 3000; and <sessionState mode="InProc" cookieless="false" timeout="300"> Carpe Diem ASP .Net 3 02-23-2004 07:10 PM
web.config session timeout and forms authentication timeout Do ASP .Net 2 11-23-2003 02:27 PM