in reply to Adding sessionid to all links in HTML-document
Take a look at some of the prior art:
Also, consider the classic trick of putting the session ID first in the path and using relative URLs: