Click to See Complete Forum and Search --> : Still confused Post timeout


tripwater
10-23-2003, 09:55 AM
most all sites I visit handle the back button and never have to deal with the inconveinence of the resend post data popup warnings.

I have been told to put meta tags (pragma=no-cache) I tried this and it did not seem to work for me.

So are all of those sites setting this meta tag? If so, does this not mean that the browser does not cache ?

How does Amazon.com and sites like that hold all of my user info when I hit the back button without it caching?

I do not get that message on sites like that. I would offer maybe session vars, but that would mean they are setting every POST element = to a session var (or are they using cookies for every element in the form?)so you could view it again and I don't see how that is possible with heavy traffic like Amazon gets. I am really ignorant to this aspect of a website so I apologize. Please clarify if anyone knows the answer.

Thank you for any help.

PunkSktBrdr01
10-23-2003, 11:56 AM
Maybe they're passing info through GET?

tripwater
10-23-2003, 12:33 PM
Thanks for the reply. Unfortunately from what I understand the GET method joins all the field names and their associated values into one long string and Unix and most other operating systems seem to put a limit on the length of that string (UNIX 255 chars).

I won't be able to use this as my form asks for a good bit of user info. If I am incorrect in this please let me know.


Thanks again.

PunkSktBrdr01
10-23-2003, 01:23 PM
GET puts each item in the form into the URL. If you had this form:


<form action="action.php" method="get">
<input type="text" name="text1" value=""><br>
<input type="check" name="check1" value="1"><br>
<input type="submit" name="submit" value="SUBMIT">
</form>


and you submitted it, you would be taken to the page "action.php?text1=value&check1=value&submit=SUBMIT". In PHP, the form items will become variables, with the name of the item as the name of an index in the $_GET variable (such as $_GET['input1']), and the item's value as its value.

tripwater
10-23-2003, 01:30 PM
Yes I understand that. But it still does not take care of the character length limit set by the OS I mentioned. Is this not an issue?

PunkSktBrdr01
10-23-2003, 02:26 PM
Okay, I think I misunderstood your original question. When you say that the sites hold your user info, do you mean that you submitted a form and they displayed it? If you mean going into a user control panel, that's most likely done with a database. They use cookies to make sure you are logged in, and then retrieve the user info from a database.

tripwater
10-23-2003, 02:49 PM
Well actually what I am doing is setting my post vars = session vars until final page. I get their user info then the billing address then payment info all on separate pages. I would like to be able to not submit each page until the final processing page that way I save on disk space if they cancel or close their browser.

But if along the way they made a mistake and say, needed to change their address and hit back I would like for them to be able to hit back in the browser and their info still be there without them having to deal with the post data resend message.

I went to amazon.com and they manage to do this and they are using POST in the form.

Does this help?

PunkSktBrdr01
10-23-2003, 03:29 PM
If you want users to be able to go back, you should make another form on the page that has all of the previously submitted values (probably have submit button say "Back to step 1", or something like that). Then, on page 1, have a script that checks to see if the user submitted the "Back to step 1" form. If they did, have it fill all the inputs with the previously submitted values. Hope that isn't too confusing! :)

tripwater
10-23-2003, 04:21 PM
I appreciate the help.

But that still leaves them the option of hitting the back button and getting the resend post warning.

I am using session variable now to auto populate the form when they hit back so getting the info back into the fields is not a problem.

My main priority is to stop the resend post data window from coming up, again I know it can be done because amazon and other sites do it. I just need to know how whether it is a meta tag, javascript, or an apache setting.

Thanks again

PunkSktBrdr01
10-23-2003, 06:13 PM
Well, I'm out of ideas. Have you checked the source code on those sites? I can't think of any other way to figure it out.

RedGoldenSun
06-21-2006, 12:16 AM
Yeah, I know this thread is old and will likely fall upon deaf ears [blind eyes?] :eek: , but I was searching for this exact answer today and it was rather difficult to find.

Anyway, to rid the 'resend post data' warnings (using PHP):

session_start();
header("Cache-control: private");

nickel
10-31-2006, 10:56 PM
Yeah, I know this thread is old and will likely fall upon deaf ears [blind eyes?] :eek: , but I was searching for this exact answer today and it was rather difficult to find.

Anyway, to rid the 'resend post data' warnings (using PHP):

session_start();
header("Cache-control: private");

YES finally something! Red, thanks for posting your findings - even if it is three years later (haha).

nickel
10-31-2006, 11:24 PM
Hmm. header("Cache-control: private") didn't work for me but set me in the right direction. :P

This was my fix:

session_cache_limiter('private'); (BEFORE starting the session) as per http://www.php.net/manual/en/function.session-cache-limiter.php

POST resend warning(via browser back button) GONE in FF and IE. :cool: Thanks again Red and Trip for contributing.