Yes, you do need this (or else visits from mydomain.com to myotherdomain.com will be counted as two different visitors with mydomain.com as refering site).
You can use _setCookiepath (in the code for myotherdomain.com ) to limit the Google Analytics cookie to your subdirectory:
_gaq.push(['_setCookiePath', '/myfolder']);