Advertisement
carlos1993

Untitled

Jun 27th, 2013
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.98 KB | None | 0 0
  1. public function regen_id(){
  2.         $sessionId = session_id();
  3.         echo $sessionId;
  4.         $qry = "INSERT INTO sessiondeletequeue VALUES (:id, 0)";
  5.         if(!isset($this->regQuery)){
  6.             $this->regQuery = $this->pdo->prepare($qry);
  7.         }
  8.         $this->regQuery->bindParam(':id', $sessionId, PDO::PARAM_STR);
  9.         if($this->regQuery->execute()){
  10.             session_regenerate_id();
  11.             echo "<br>";
  12.             $this->forceDelete();
  13.             return true;
  14.         }
  15.         else{
  16.             return false;
  17.         }
  18.     }
  19.     private function forceDelete(){
  20.         $qry = "SELECT id FROM sessiondeletequeue";
  21.         foreach($this->pdo->query($qry) as $row){
  22.             $this->destroy($row['id']);
  23.             $this->pdo->query("UPDATE sessiondeletequeue SET deleted = 1");
  24.         }
  25.         $this->pdo->query("DELETE FROM sessiondeletequeue WHERE deleted = 1 ");
  26.     }
  27.     private function encrypt(&$data) {
  28.  
  29.         return $data;
  30.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement