note 8595 deleted from function.session-start by jimw

From: Date: Fri, 07 Dec 2001 20:23:50 +0000
Subject: note 8595 deleted from function.session-start by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-21888@lists.php.net to get a copy of this message
A funny thing that if it happen to you (just like it happen to me few hours ago) to use a form on page that also ha s sessions in it your browser will cache it permanently. It means that if your form, when it's being validated, tells a visitor "a missing email, please return to the form and make corrections" then if he hits back button of his browser none of the fields will remain intact: in fact what you will see is the "first version" of that page, like when you first got there. To fix it is easy: Always use the non-cache header by PHP. Like this: header ("Cache-Control: no-cache, must-revalidate"); header ("Pragma: no-cache"); // See header() In that case your page will be forsed not to be cached and your browser will give you the real "last page" on back button hit. Maxim Maletsky

« previous php.notes (#21888) next »