open website b with a parameter in the url which you want to pass to website b, like
http://websiteb/index.html?user=one
this website rewrites its urls ( using javascript if you really want, but serverside tech is preferred ) so that this parameter is included in the link to website a, along with something added there.
like :
http://websitea/page.html?user=one&var=something
Grab variables from the http get request and process accordingly