The chache methode of /lib/exe/js.php not suitable for multi homed wiki's.
example: var DOKU_BASE='http://example.com/wiki/';
John uses the address http://example.com/wiki/
John logs in and uploads a pictue.
The jvascript chached and conatins var DOKU_BASE='http://example.com/wiki/';
Bob uses the address http://www.example.com/wiki/
Bob logs in and tries to upload a pictue.
But the upload fails because authenticated at www.example.com and the media manager window opened from example.com and Bob doesn't have the appropriate cookies for example.com
Generate different chache file name for different host names.
Change the 38th line of the js.php something like:
// The generated script depends on some dynamic options
$cache = getCacheName('scripts'.$_SERVER['HTTP_HOST'].$_SERVER['SERVER_PORT'].$edit.'x'.$write,'.js');