| | |
| | | * Handler for session_destroy() |
| | | * |
| | | * @param string Session ID |
| | | * |
| | | * @return boolean True on success |
| | | */ |
| | | public function db_destroy($key) |
| | | { |
| | | $this->db->query( |
| | | sprintf("DELETE FROM %s WHERE sess_id = ?", $this->db->table_name('session')), |
| | | $key); |
| | | if ($key) { |
| | | $this->db->query(sprintf("DELETE FROM %s WHERE sess_id = ?", $this->db->table_name('session')), $key); |
| | | } |
| | | |
| | | return true; |
| | | } |
| | |
| | | * Handler for session_destroy() with memcache backend |
| | | * |
| | | * @param string Session ID |
| | | * |
| | | * @return boolean True on success |
| | | */ |
| | | public function mc_destroy($key) |
| | | { |
| | | return $this->memcache->delete($key); |
| | | if ($key) { |
| | | // #1488592: use 2nd argument |
| | | $this->memcache->delete($key, 0); |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | |
| | |
| | | public function set_keep_alive($keep_alive) |
| | | { |
| | | $this->keep_alive = $keep_alive; |
| | | |
| | | |
| | | if ($this->lifetime < $keep_alive) |
| | | $this->set_lifetime($keep_alive + 30); |
| | | } |
| | |
| | | { |
| | | return $this->ip; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Setter for cookie encryption secret |
| | | */ |
| | |
| | | { |
| | | $this->ip_check = $check; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Setter for the cookie name used for session cookie |
| | | */ |
| | |
| | | $result = true; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (!$result) |
| | | $this->log("Session authentication failed for " . $this->key . "; invalid auth cookie sent; timeslot = " . date('Y-m-d H:i:s', $prev)); |
| | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * Writes debug information to the log |
| | | */ |
| | | function log($line) |
| | | { |