Vinay Sajip's answer hv all to be right, but doesnt work with me.
thats what i've done :
1 - Set my servlet (in this case, doPost) to synchronized.
protected synchronized void doPost(HttpServletRequest request, HttpServletResponse response)
2 - in upload_url from swfupload, i passed through the session ID
upload_url: "Controller?action=33&JSESSIONID=<%=request.getSession().getId()%>",
3 - back to the servlet, i forced the cookie JSESSIONID to my "old" session:
if (request.getParameter("JSESSIONID")!=null) {
Cookie userCookie = new Cookie("JSESSIONID", request.getParameter("JSESSIONID"));
response.addCookie(userCookie);
}
should work.
i've used synchronized because to not have a "duplicate" value of sessionId. (or my firebug is crazy)