Passing _session_id with multipart forms

The Macromedia Flash 8 FileReference.upload() function uploads files by
sending a multipart POST request to the server. Unfortunately, there is
a bug that prevents Firefox cookies from being sent along with the
request, so a different Session is created. I’m having my Flash code use
ExternalInterface to call a Javascript function on the page with the
Flash movie. The JS function returns the _session_id from the user’s
cookie, which Flash then uses to append to the request it sends to the
server when uploading a file (as described at
http://weblog.rubyonrails.org/articles/2006/04/19/stress-testing-your-protected-pages).

However, it seems that in certain situations (mine being one of them)
Rails and the Ruby CGI class fail to use the correct Session as passed
in through the params. This is described at
http://dev.rubyonrails.org/ticket/210 and there is a patch which doesn’t
apply to my situation (as I cannot modify the form that Flash sends to
the server, to include a hidden field with _session_id).

Is there some (ugly and hackish) way that I can switch to the
appropriate Session manually, once I have the correct Session ID?