Keep the query string and path in store_location_for

Persist the URI's query when saving to the session.

Fixes #2742
Merge pull request #2749 from csexton/master

Keep the query string and path in store_location_for