Cache-control, browser's back button and form data
Posted: Fri Sep 15, 2006 6:55 am
Hi
I'm working on an intranet project and there's a form that users have to fill in.
Sessions are involved in one of the iframes on the page.
When the user submits the form, the data gets validated by my php script.
But if there's an error, I have a link to the previous page
But when they hit the link their data is gone from the form and they have to enter it all again.
On that form page though, I have the following PHP code which starts the session...
Although I might be able to get rid of that since sessions are not actually used in this PHP script - only in one of the iframes.
My main question is, what determines whether the data stays in the input fields when the user presses back to a form?
Is it that Cache-control: private header?
Thanks
I'm working on an intranet project and there's a form that users have to fill in.
Sessions are involved in one of the iframes on the page.
When the user submits the form, the data gets validated by my php script.
But if there's an error, I have a link to the previous page
Code: Select all
javascript:history.back();On that form page though, I have the following PHP code which starts the session...
Code: Select all
// START SESSION
session_start();
// 'CACHE-CONTROL: PRIVATE' FIXES SESSIONS BUG IN IE6
header('Cache-control: private');My main question is, what determines whether the data stays in the input fields when the user presses back to a form?
Is it that Cache-control: private header?
Thanks