trapping repeatition
Posted: Tue Jul 05, 2005 3:09 am
This is one of those refresh problem on browsers.
I have a single script that checks if it is already executed by user. It uses sessions.
Now, when the user will refresh this script after already executing it, it will not be excuted because of the if statement.
But from now on, every POST variables to be passed in this script will not work because the session is still alive.
Of course, you may say that I have to session_destroy() or unset() this session variable. But doing so, will disable my checking, making the script to be executed repeatedly on browser refresh.
Any idea on how or when to kill session without spoiling the checking?
I have a single script that checks if it is already executed by user. It uses sessions.
Code: Select all
session_start();
if(!isset($_SESSION['executed'])){
/*
bunch of codes here ...
*/
$_SESSION['executed'] = true;
}But from now on, every POST variables to be passed in this script will not work because the session is still alive.
Of course, you may say that I have to session_destroy() or unset() this session variable. But doing so, will disable my checking, making the script to be executed repeatedly on browser refresh.
Any idea on how or when to kill session without spoiling the checking?