The site in question is:


Click on any of the series images on this page and you'll be taken to that individual series' page:


If you click Go back, great, we go back to the first link. Instead we'll go into an individual message by clicking on one of the message images/links and end up at:


Click on Go Back and we are back to the Series view page. Now click Go Back on the Series view page and we are taken to the individual messages page.

Technically, everything is working correctly. The page I was on before I went back to the series page was the individual message page and that is where it takes me...but functionally this is not what I need. Instead, when an individual has gone into an individual message and then returns to the series I need for the Go Back on the series page to take them to:


Simple answer is to simply tell it what page to go back to, e.g. I could code the series page Go Back link to always go to:


But this causes another issue. The /messages/ page is paginated and I don't want the individual to be on the fourth page of results (/messages/message-app-view/page/4/) and when they click Go Back from the series page they find themselves back on the first page of results (/messages/messages-app-view/)

I'm thinking I could pass the page variable to the series page, but what if the individual then goes into a message? Do I pass the page variable around and around and around?

Suggestions on a good way to resolve this are appreciated. :)

1 Answer 1


You could use cookies. Set a cookie for each "level" (Messages, Series, Message) with the URL the user has last been on (including pagination). If no value is set for, say, Messages, because the user has jumped directly into Series, then you go to the default Messages URL without pagination - if a value is set, you go there.

It'll never be perfect, if somebody uses multiple tabs (if your app allows that), they might be on page 4 of Messages in one tab and on page 5 in the next. Since cookies aren't tab based, you wouldn't be able to know in which tab they are click the "Go back" button. But I think it would be close enough.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.