reset.php 425 B

1234567891011121314151617181920
  1. <?php
  2. //Recup de la session
  3. if(!isset($_COOKIE['salon']) || !isset($_COOKIE['common-sess'])){
  4. exit(json_encode(['etat' => 'err']));
  5. }
  6. if($_COOKIE['common-sess'] != $_COOKIE['salon']){
  7. exit(json_encode(['etat' => 'err']));
  8. }
  9. //Lancement session
  10. session_name('common-sess');
  11. session_start();
  12. //Vide la session
  13. $_SESSION['user'] = [];
  14. $_SESSION['roll'] = [];
  15. //Retour
  16. echo json_encode(['etat' => 'ok']);