Create or delete php session

0

I want to know how to delete the sessions in PHP, I want to make a copy of my application, and the index.php shows me that the session has finished and that I must log in again, thanks.

<?php
    include('configuracion/conectar.php');


    if(isset($_COOKIE['asiste_cookie']) && $_COOKIE['asiste_cookie'] != 'true'){
        $asis_cookie = $_COOKIE['asiste_cookie'];
        //echo $asis_cookie;
        //list($campo1,$campo2) = split("-", $asis_cookie);
        $campo1 = $asis_cookie;
        $campo2 = '';
    }else{
        $campo1 = 'false';
        $campo2 = '';
    }
    $cualver            = '?v2.7.2.1006';
    $_SESSION["VERSION"]= $cualver;

?>
    
asked by Luis Eduardo Martinez Ocoro 25.08.2017 в 18:21
source

1 answer

0

use this

<?php
      if (ini_get("session.use_cookies")) {
      $params = session_get_cookie_params();
      setcookie(session_name(), '', time() - 42000,
          $params["path"], $params["domain"],
          $params["secure"], $params["httponly"]
      );
      }
      session_destroy();
    $url = "./../index.php";
    header("Location:" . $url);
 ?>

you have to address that page with the following code

<a class="link2 fa fa-power-off"  href="sessionclose.php">  Cerrar Sesion</a>
    
answered by 25.08.2017 / 18:29
source