I'm not sure what previous discussion you mentioned, but I've recently experienced the same thing. I'm doing essentially the same thing that Trindaz is doing with approximately the same result. To work around this I ended up writing my own URL.join() function:
class URL
@join: (base, url) ->
if /^https?:/.test url
#
url
else if /^\//.test url
# new url is not absolute, but has absolute path (e.g. /logout)
# strip out the existing path and use the new one, keeping the domain
#
#
base.match(/^(https?:\/\/[^/]+)/)[1] + url
else if base[base.length-1] is '/'
# new url is relative and old url ends in a slash, so just append the new one
#
#
base + url
else
# new url is relative and old url does not end in a slash
#
#
base.substring(0, base.lastIndexOf('/')) + url
While this works, it's important to stress that setting window.location.href to a relative url works fine in a normal browser. I'm guessing phantomjs is doing something differently around this that causes it to not work in this case. I'm happy to assist debugging this issue if needed.
-bd