Use query string before restoring session