Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6100173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:21:21+00:00 2026-05-23T13:21:21+00:00

I apologize for vague title so let me explain. Suppose you have a page

  • 0

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:

  1. Foo – http://example.com/foo
  2. Bar – http://example.com/bar
  3. 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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:21:21+00:00Added an answer on May 23, 2026 at 1:21 pm

    So I came up with the following solution.

    I add onclick handler to all item links on search results page. This handler sets a session cookie with Javascript. This cookie contains the information about current search query.

    On item details page I parse this cookie to retreive the information about the search query. It allows me to find next/previous items in search results and add the “Back to search results” link.

    This approach works even if user has several search results pages opened in different tabs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First, I wish to apologize if the title is vague, the question is hard
Apologies for the vague title, but this is quite a difficult problem to explain
I apologize for the vague title. I am attempting to write a query that
Apologies for the vague title, it's kind of hard to explain in a line...
This could be a repeat question, I apologize. I have a jsp page in
I apologize for asking a very vague question but here it is. I have
I apologize for the vague title, but I can't think of a better way
I apologize if the title is not clear, but I couldn't explain it succinctly.
Apologies for the vague question. Here it is: I have a table object created
Apologize if this particular problem has been answered already (a search didn't turn anything

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.