method saveSession documentation in bbn\User

Saves the session config in the database.

function(bool $force = false) { $id_session = $this->getIdSession(); if ($this->check()) { if ($id_session) { $p = &$this->class_cfg['arch']['sessions']; // It is normal this is sometimes not changing as different actions can happen in the same $time = time(); if ($force || empty($this->sess_cfg['last_renew']) || ($time - $this->sess_cfg['last_renew'] >= 2)) { $this->sess_cfg['last_renew'] = $time; $this->db->update( $this->class_cfg['tables']['sessions'], [ $p['id_user'] => $this->id, $p['sess_id'] => $this->session->getId(), $p['ip_address'] => $this->ip_address, $p['user_agent'] => $this->user_agent, $p['opened'] => 1, $p['last_activity'] => date('Y-m-d H:i:s', $time), $p['cfg'] => json_encode($this->sess_cfg) ], [$p['id'] => $id_session] ); } } else { $this->setError(13); } } return $this; }

Saves the session config in the database. BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way

This website uses cookies to ensure you get the best experience on our website.