Better handle queries when building the session url