Because the flash sent in Firefox browser will not have a cookie, so the background of the session failed.
The workaround is to manually pass SessionID to the background.
$ ("#fileresultfiles"). Uploadify ({swf: '/scripts/uploadify/uploadify.swf ', uploader: '/uplo Adfiles.ashx ', Queueid: ' Filequeue ', ButtonText: ' Attachment upload ', auto:true, Debug:false, Removecompleted:true, Multi:true, Displaydata: ' Speed ' , uploadlimit:20, Filesizelimit: ' 500MB ', FormData: {' AS Psessid ': ' <%=session.sessionid%> ', ' PrimaryKey ': $ ("#<%=hid_resultstrid.clientid%>"). val (),}, Onqueuecomplete:function (queuedata) {//queue upload completed, Ajax gets all lists uploaded Ajaxrequestfile (); }, Onselecterror:function (file, ErrorCode, errormsg) {var errormsg = ""; if (ErrorCode = = "queue_limit_exceeded") {errormsg = "Too many files! "; } if (ErrorCode = = " -110") {errormsg = "file size exceeded limit!"} "; } $ (' # ' + file.id). Find ('. Data '). HTML (' errormsg '); }, Onuploadsuccess:function (file, data, response) {if (Data! = "OK") { $ ("#fileresultfiles"). Uploadify (' Cancel ', ' * '); alert (data); } } });
' Aspsessid ': ' <%=session.sessionid%> ' is to pass the SessionID to the past
Then listen to each request in the Global.asax file and reset the cookie if any of the SessionID pass through.
protected void Application_BeginRequest (object sender, EventArgs e) {//for uploadify in Google and Firefox can not upload the B UG try {string session_param_name = "Aspsessid"; String session_cookie_name = "Asp.net_sessionid"; if (httpcontext.current.request.form[session_param_name]! = null) {Updatecookie (session _cookie_name, Httpcontext.current.request.form[session_param_name]); } else if (httpcontext.current.request.querystring[session_param_name]! = null) { Updatecookie (Session_cookie_name, Httpcontext.current.request.querystring[session_param_name]); }} catch {}} private void Updatecookie (string cookie_name, St Ring cookie_value) {HttpCookie cookie = HttpContext.Current.Request.Cookies.Get (cookie_name); if (null = = CookiE) {cookie = new HttpCookie (cookie_name); Cookies. Value = Cookie_value; HttpContext.Current.Request.Cookies.Set (cookie);//Reset the cookie value in the request and assign the server-side session value to it}}
Fix file Upload plugin uploadify in Firefox, Session lost problem