Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function regen_id(){
- $sessionId = session_id();
- echo $sessionId;
- $qry = "INSERT INTO sessiondeletequeue VALUES (:id, 0)";
- if(!isset($this->regQuery)){
- $this->regQuery = $this->pdo->prepare($qry);
- }
- $this->regQuery->bindParam(':id', $sessionId, PDO::PARAM_STR);
- if($this->regQuery->execute()){
- session_regenerate_id();
- echo "<br>";
- $this->forceDelete();
- return true;
- }
- else{
- return false;
- }
- }
- private function forceDelete(){
- $qry = "SELECT id FROM sessiondeletequeue";
- foreach($this->pdo->query($qry) as $row){
- $this->destroy($row['id']);
- $this->pdo->query("UPDATE sessiondeletequeue SET deleted = 1");
- }
- $this->pdo->query("DELETE FROM sessiondeletequeue WHERE deleted = 1 ");
- }
- private function encrypt(&$data) {
- return $data;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement