GeeCON Prague 2014*
The moose likes Servlets and the fly likes J2EE Session Expires with Large File Upload Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "J2EE Session Expires with Large File Upload" Watch "J2EE Session Expires with Large File Upload" New topic
Author

J2EE Session Expires with Large File Upload

Sandy Fiasher
Greenhorn

Joined: Jul 14, 2009
Posts: 8
Hello All

This is in regards to a issue related with large File Upload and J2EE Session

Issue -

When a large file is uploaded from a web application and that transfer rate exceeds the session timeout, the user is back to login page.

Required Testcase -

The session should not expire when file is getting uploaded

Analysis -

There are multiple options to address this situation, however nothing seems to fit appropriately. I cannot increase session timeout as it will affect overall application, there is a security risk if session is set to max (setMaxInactiveInterval as -1).

I am thinking in line on implementing something at listner level (but looks like the HTTPSessionListner will come late as handler) or something to keep the session alive using META-REFRESH

I am looking if someone has dealt with this scenario before and how that's implemented (if there is any other better solution that could address this quite obvious scenario)

Really appreciate feedback
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Don't you have a progress indicator? If so, that should be enough (your meta-refresh thing, or via Ajax). If not, it's a bad/puzzling user experience, so I'd sure recommend it.
Manish Singh
Ranch Hand

Joined: Jan 26, 2007
Posts: 160
a progress indicator will be the ideal solution for you.
As it will be communicating with the server while the upload is in progress that will keep your session alive. It will also prove better user experience.
Sandy Fiasher
Greenhorn

Joined: Jul 14, 2009
Posts: 8
Unfortunately, No - I don't have the Progress Bar - Looking into that option now - Thanks
 
GeeCON Prague 2014
 
subject: J2EE Session Expires with Large File Upload