'extend session expiry'

def update(self, force=False):

    if ((frappe.session[u'user'] == u'Guest') or (frappe.form_dict.cmd == u'logout')):
        return
    now = frappe.utils.now()
    self.data[u'data'][u'last_updated'] = now
    self.data[u'data'][u'lang'] = text_type(frappe.lang)
    last_updated = frappe.cache().hget(u'last_db_session_update', self.sid)
    time_diff = (frappe.utils.time_diff_in_seconds(now, last_updated) if last_updated else None)
    updated_in_db = False
    if (force or (time_diff == None) or (time_diff > 600)):
        frappe.db.sql(u'update    tabSessions    set    sessiondata=%s,\n DCTB  DCTB  DCTB  DCTB lastupdate=NOW()    where    sid=%s', (str(self.data[u'data']), self.data[u'sid']))
        frappe.db.sql(u'update    `tabUser`    set    last_active=%(now)s    where    name=%(name)s', {u'now': now, u'name': frappe.session.user})
        frappe.db.commit()
        frappe.cache().hset(u'last_db_session_update', self.sid, now)
        updated_in_db = True
    frappe.cache().hset(u'session', self.sid, self.data)
    return updated_in_db
