Sayfa yakın bir PHP oturumu bitirmek için nasıl

0 Cevap php

I have several pages inside an AJAX directory. I don't want these pages accessible directly so you cannot just type in the URL of the page within the AJAX directory and access it. I "solved" this by using a PHP session on the page that calls it as follows: Main page:

<?php
session_start();
$_SESSION['download']='ok';
?>

ve ajax sayfada bu var:

<?php
session_start();
if($_SESSION['download']!=='ok'){
$redirect='/index.php'; //URL of the page where you want to redirect.
header("Location: $redirect");
exit;}
?>

Tek sorun, bir kullanıcı bir kez doğru sürecinde giderse, çerez saklanır ve onlar şimdi sayfayı doğrudan ulaşabiliyor. Onlar ana sayfa bırakın sonra nasıl oturumu öldürürüm?

thx

0 Cevap