Destroy PHP session after set amount of time (not due to inactivity) <p>I have read numerous posts about destroying a PHP session after a set amount of time, but many of the answers don't clarify whether the solution works for inactivity or for a set period of time. Let me expound.</p> <p>I am using php to generate and grade a quiz. Each question is dynamically generated and the user must hit the submit button to move on to the next question, thereby generating a request to the php script. </p> <p>I want the user to only have 15 total minutes to complete it. In other words, if it takes the user 6 minutes to do the first 3 problems, then the user has 9 minutes left to do the other 3 problems.</p> <p>If you set your inactive time to 15 minutes, then presumably the user has 15 minutes in-between requests to the webpage, correct? <a href="http://stackoverflow.com/questions/520237/how-do-i-expire-a-php-session-after-30-minutes">This</a> is the solution that this answer provides I believe.</p> <p>However, that is not what I need. I need for the session to terminate after 15 total minutes from the start, regardless of whenever the last request was made by the user.</p> <p>Thank you</p>