36 public function read($session_id) {
39 $query =
"SELECT * FROM {$this->db->getTablePrefix()}users_sessions WHERE session='$id'";
40 $result = $this->db->getDataRow($query);
51 public function write($session_id, $session_data) {
56 $query =
"REPLACE INTO {$this->db->getTablePrefix()}users_sessions 57 (session, ts, data) VALUES 58 ('$id', '$time', '$sess_data_sanitised')";
60 if ($this->db->insertData($query) !==
false) {
80 $query =
"DELETE FROM {$this->db->getTablePrefix()}users_sessions WHERE session='$id'";
81 return (
bool) $this->db->deleteData($query);
87 public function gc($max_lifetime) {
89 $life = time() - $max_lifetime;
90 $query =
"DELETE FROM {$this->db->getTablePrefix()}users_sessions WHERE ts < '$life'";
91 return (
bool) $this->db->deleteData($query);
if($guid==elgg_get_logged_in_user_guid()) $name
sanitize_string($string)
Sanitize a string for database use.
__construct(\Elgg\Database $db)
Constructor.
write($session_id, $session_data)
if(!$collection_name) $id