What can cause loosing the session when using AjaxUploader?

Last post 10-20-2009, 3:59 PM by pierre. 2 replies.
Sort Posts: Previous Next
  •  10-20-2009, 7:57 AM 56509

    What can cause loosing the session when using AjaxUploader?

    After having uploaded files with AjaxUploader in a page, moving programatically to another page causes the Session_End() event (defined in global.asax ) to be fired, and as a consequence the collection System.Web.HttpContext.Session is emptied ...
    If I use a standard FileUpload control rather that AjaxUploader, this does not happen.
    Any idea concerning what can cause the session to be lost?
    Thanks in advanced
    Pierre-Henri
  •  10-20-2009, 11:18 AM 56518 in reply to 56509

    Re: What can cause loosing the session when using AjaxUploader?

    Pierre,
     
    Does your code make directory or something let the ASP.NET restart ?
     
    Please try this :
     
     
    Regards,
    Terry
  •  10-20-2009, 3:59 PM 56531 in reply to 56518

    Re: What can cause loosing the session when using AjaxUploader?

    Hi Terry,
    Thanks for your quick reply, I have resolved my problem. I write here what was wrong in order to share it with anybody who would have similar symptoms.
    At the origin of the problem, the property UploaderBase.TempDirectory was (mistakely) set to an empty string in my code. As a result, AjaxUploader used to save temp files directly in the web application folder.
    After submitting, we were doing other manipulations on the files (parsing, thumbnails generation, ...). And manipulating files inside the web application folder caused the loss of the session.
    A suggestion however : maybe the value passed to the property UploaderBase.TempDirectory could be ignored when it is null or empty. So that it is possible to bind it directly to a value coming from an external configuration (configuration file, database, etc...). Actually, it is what was happening in my case, and my "TempDir" parameter was set to null, which means "use the default temp folder".
     
    That's all!
    Pierre
View as RSS news feed in XML