PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
This function will time out exactly 2 hours after the page is first called I believe. How would I fix this to make it reset the two hours every time the page loads? (my brain is kinda on vacation right now)
function set_time_out(){
// Set time start
$this->duration = 60*60 * 2;
$this->time_start = $this->get_var('time_start');
if(!empty($this->time_start)){
$this->time_out = ($this->time_start + $this->duration);
if(time() > $this->time_out) $this->destroy();
}
else{
$this->time_start = time();
$this->set_var('time_start', $this->time_start);
}
$this->set_var('time_start', time()); // <-- I just needed to add this line I figured it out thanks!
}