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.
Quick Session Question
Moderator: General Moderators
- seodevhead
- Forum Regular
- Posts: 705
- Joined: Sat Oct 08, 2005 8:18 pm
- Location: Windermere, FL
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact: