I apologize for vague title so let me explain.
Suppose you have a page with search results: http://example.com/search?q=foo. The results are:
- Foo - http://example.com/foo
- Bar - http://example.com/bar
- Baz - http://example.com/baz
The links above point to the item details page. On these pages I want to display links which allow to navigate through search results: Next Item, Previous Items, Back to Search Results.
So when generating a details page I need to know where the user came from, for instance I need to know which search term he used.
I could add additional query params in URLs, like http://example.com/foo?from=search&q=foo but I can't do that. The requirement is not to add any additional params to items' URLs.
Another option is to save search query in session. But it does not work if user opens several search result pages in different tabs.
How would you do that?
PS. I know there is a number of similar questions here but didn't find the one that can help in my case.