I have an area of a secured site that allows a user to request access to documents. The access needs to be limited to a certain length of time so I want to calculate a timestamp for when the user first requests access as well as calculate a timestamp based on a certain amount of time in the future.
I could do this by simply doing something like:
$requestTime = time();
But then what is the best method for calculating the future expiry date? Can I use strtotime() to adequately calculate the expiry based on $requestTime + the strtotime() result?
Or is there a better, more accepted way for calculating precise expiry dates?
As a follow-up... would it be best to store both times in a database and run a pruning script with cron to automate the [process of reviewing and revoking access?
Thanks in advance.