timing out a session
Posted: Tue Jun 06, 2006 3:37 pm
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)
Code: Select all
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);
}
}