Quick Session Question
Posted: Sat Mar 17, 2007 3:59 pm
Hey guys... I have a page on my site that allows a user to submit a form... but I only want the person to be able to submit the form once every 24 hours. So as a way to enforce this, I am using a session variable.
How it works:
1. User submits form. Session variable is set to time();
2. If user submits form again, the php asks if isset($_SESSION['formSubmitTime']) and if so, then asks if $_SESSION['formSubmitTime'] < time()*60*60*24.
My question:
Is it okay to set a session variable to last 24 hours? I dunno why it just seems like 24 hours is a long time to maintain a session, am I wrong? Thanks for any advice on this matter.
How it works:
1. User submits form. Session variable is set to time();
2. If user submits form again, the php asks if isset($_SESSION['formSubmitTime']) and if so, then asks if $_SESSION['formSubmitTime'] < time()*60*60*24.
My question:
Is it okay to set a session variable to last 24 hours? I dunno why it just seems like 24 hours is a long time to maintain a session, am I wrong? Thanks for any advice on this matter.