determining query string for login