Back button problem with $Sessions and GET

Reply

Join Date: Jul 2004
Posts: 57
Reputation: bwest is an unknown quantity at this point 
Solved Threads: 1
bwest's Avatar
bwest bwest is offline Offline
Junior Poster in Training

Back button problem with $Sessions and GET

 
0
  #1
Jul 15th, 2004
If your familiar with database search results, then you probably know how useful the GET method is. My results page is a list of site members from the database. We want to have a feature that allows users to add these members to a html select box to "save a list of favorites". Every time a user clicks the Add button, the page redirects to itself and we are using session variables to save the list.

Here's the problem with the Browser Back button

1.) Lets say your on page one and you add two members to the list. The GET url will have &list=1,2 appended to the end where 1 and 2 are the two members. The session looks at the variable called "list" and makes an array from the list
2) The user goes to page two of the search results. They add another member. Because the page redirects to itself right after adding to save the added member, the new GET url is &list=1,2,3 The session is resaved with this list
3) The user clicks "BACK". Browsers dont rebuild a dynamic page when you click back so the member that got added in the second page is not present.

How do I solve the back problem?

-Brad
Reply With Quote Quick reply to this message  
Join Date: May 2004
Posts: 141
Reputation: meabed is on a distinguished road 
Solved Threads: 3
Team Colleague
meabed's Avatar
meabed meabed is offline Offline
Junior Poster

Re: Back button problem with $Sessions and GET

 
0
  #2
Sep 12th, 2009
This is what I do to accomplish the task of disabling the cache..
The head tag at the end of the document is important!
  1. <html>
  2. <head>
  3. <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
  4. <META HTTP-EQUIV="Expires" CONTENT="-1">
  5. </head>
  6. <body>
  7. Body stuff
  8. </body>
  9. <HEAD>
  10. <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
  11. <META HTTP-EQUIV="Expires" CONTENT="-1">
  12. </HEAD>
  13. </html>
Real Eyes Realize Real Lies
My Resume
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC