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

Discussion in 'ASP .Net Security' started by bhatti, Mar 22, 2005.

  1. bhatti

    bhatti Guest

    Hi,

    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
    page.

    The machine.config has the following settings:
    <httpRuntime maxRequestLength="131072" executionTimeout="36000"/>
    and
    <sessionState mode="InProc"
    stateConnectionString="tcpip=127.0.0.1:42424" stateNetworkTimeout="10"
    sqlConnectionString="data source=127.0.0.1;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
    bhatti.
     
    bhatti, Mar 22, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Do
    Replies:
    2
    Views:
    6,383
  2. Alexander Malkis
    Replies:
    8
    Views:
    526
    Alexander Malkis
    Apr 14, 2004
  3. Roger23
    Replies:
    2
    Views:
    1,007
    Roger23
    Oct 12, 2006
  4. =?Utf-8?B?Um9iSEs=?=
    Replies:
    4
    Views:
    5,294
    =?Utf-8?B?Um9iSEs=?=
    Apr 11, 2007
  5. Mark Probert

    Timeout::timeout and Socket timeout

    Mark Probert, Oct 6, 2004, in forum: Ruby
    Replies:
    1
    Views:
    1,293
    Brian Candler
    Oct 6, 2004
Loading...

Share This Page