36 public function read($session_id) {
39 $query =
"SELECT * FROM {$this->db->prefix}users_sessions WHERE session='$id'";
40 $result = $this->db->getDataRow($query);
51 public function write($session_id, $session_data) {
56 $query =
"INSERT INTO {$this->db->prefix}users_sessions 57 (session, ts, data) VALUES 58 ('$id', '$time', '$sess_data_sanitised') 59 ON DUPLICATE KEY UPDATE ts = '$time', data = '$sess_data_sanitised'";
61 if ($this->db->insertData($query) !==
false) {
81 $query =
"DELETE FROM {$this->db->prefix}users_sessions WHERE session='$id'";
82 return (
bool) $this->db->deleteData($query);
88 public function gc($max_lifetime) {
90 $life =
time() - $max_lifetime;
91 $query =
"DELETE FROM {$this->db->prefix}users_sessions WHERE ts < '$life'";
92 return (
bool) $this->db->deleteData($query);
if($guid==elgg_get_logged_in_user_guid()) $name
sanitize_string($string)
Sanitizes a string for use in a query.
__construct(\Elgg\Database $db)
Constructor.
write($session_id, $session_data)
if(!$collection_name) $id