Sorunumu js taraflı cookie gönderip php ile yakalayarak çözdüm.
index.phpde;
login başarılı olduğu ajax kısmında bu cookieyi tayin ettim.
var now = new Date();
var time = now.getTime();
var expireTime = time + 1000*36000;
now.setTime(expireTime);
document.cookie = 'name=TestCookie;cookie=ok;expires='+now.toGMTString()+';path=/';
window.location = "yonetim.php";
index.php en tepedede şunu yaptım.
<?php
ob_start();
header('Content-Type: text/html; charset=utf-8');
if(!empty($_COOKIE['name'])){
Header("Location: yonetim.php");
}
?>bu sayede cookie dolu ise direk panele yönlendirdim.
admin sayfasındada şu denetimi yaptım;
<?php
include "../core/mysql.php";
if(empty($_COOKIE['name'])){
die("Bu Sayfaya giriş yetkiniz yoktur");
}
echo "admin sayfası";
?>Yöntemim bu şekilde arkadaşlar güvenilir bir yöntem mi sizce?