Fix #333

* Use last_search in session instead of relying on referrer