roundcubemail/program/lib/Roundcube/rcube_session_db.php
public function update($key, $newvars, $oldvars)
    {
        $now = $this->db->now();
        $ts  = microtime(true);

        // if new and old data are not the same, update data
        // else update expire timestamp only when certain conditions are met
        if ($newvars !== $oldvars) {
            $this->db->query("UPDATE {$this->table_name} "
                . "SET `changed` = $now, `vars` = ? WHERE `sess_id` = ?",
                base64_encode($newvars), $key);
        }
        else if ($ts - $this->changed + $this->time_diff > $this->lifetime / 2) {
            $this->db->query("UPDATE {$this->table_name} SET `changed` = $now"
                . " WHERE `sess_id` = ?", $key);
        }

        return true;
    }
public function update($key, $newvars, $oldvars)
    {
        $now = $this->db->now();
        $ts  = microtime(true);

        // if new and old data are not the same, update data
        // else update expire timestamp only when certain conditions are met
        if ($newvars !== $oldvars) {
            $this->db->query("UPDATE {$this->table_name} "
                . "SET `changed` = $now, `vars` = ? WHERE `sess_id` = ?",
                base64_encode($newvars), $key);
        }
        else if ($ts - $this->changed + $this->time_diff > $this->lifetime / 2) {
            $this->db->query("UPDATE {$this->table_name} SET `changed` = $now"
                . " WHERE `sess_id` = ?", $key);
        }

        return true;
    }
public function update ( $ key , $ newvars , $ oldvars ) { $ now = $ this -> db -> now ( ) ; $ ts = microtime ( true ) ; // if new and old data are not the same, update data // else update expire timestamp only when certain conditions are met if ( $ newvars !== $ oldvars ) { $ this -> db -> query ( "UPDATE {$this->table_name} " . "SET `changed` = $now, `vars` = ? WHERE `sess_id` = ?" , base64_encode ( $ newvars ) , $ key ) ; } else if ( $ ts - $ this -> changed + $ this -> time_diff > $ this -> lifetime / 2 ) { $ this -> db -> query ( "UPDATE {$this->table_name} SET `changed` = $now" . " WHERE `sess_id` = ?" , $ key ) ; } return true ; }
update session data

@param $key
@param $newvars
@param $oldvars

@return bool
update session data