| @@ 139-146 (lines=8) @@ | ||
| 136 | return true; |
|
| 137 | } |
|
| 138 | ||
| 139 | function destruir($id) { |
|
| 140 | if(!isset($this->delete_stmt)) { |
|
| 141 | $this->delete_stmt = $this->db->prepare("DELETE FROM sesiones WHERE id = ?"); |
|
| 142 | } |
|
| 143 | $this->delete_stmt->bind_param('s', $id); |
|
| 144 | $this->delete_stmt->execute(); |
|
| 145 | return true; |
|
| 146 | } |
|
| 147 | ||
| 148 | function gc($max) { |
|
| 149 | if(!isset($this->gc_stmt)) { |
|
| @@ 148-156 (lines=9) @@ | ||
| 145 | return true; |
|
| 146 | } |
|
| 147 | ||
| 148 | function gc($max) { |
|
| 149 | if(!isset($this->gc_stmt)) { |
|
| 150 | $this->gc_stmt = $this->db->prepare("DELETE FROM sesiones WHERE set_time < ?"); |
|
| 151 | } |
|
| 152 | $old = time() - $max; |
|
| 153 | $this->gc_stmt->bind_param('s', $old); |
|
| 154 | $this->gc_stmt->execute(); |
|
| 155 | return true; |
|
| 156 | } |
|
| 157 | ||
| 158 | private function getkey($id) { |
|
| 159 | ||