I know a SESSION can expire but what about $_REQUEST/$_POST/$_GET variables?
My question is, I have users that submit information and I need to set a Id for that information before I insert it into a database. Now I thought about using a SESSION but the problem is if the session expires before the user has submitted the information to the database they loose the Id I need. Would passing it the $_REQUEST/$_POST/$_GET variable(s) be a better solution or should I just use a variable and readjust the script?
Also I was using SESSION as it's very easy to call from inside a function without passing it in.
function setInfo() {
// no need to pass I can call from within
$Id = $_SESSION['Id'];
}
Is this good practice?
EDIT: Would this be better as a cookie?