add tests, add support for sessionid in querystring