<?php
require_once('database.php');
require_once('upper.php');
$LoginId=$_COOKIE['LoginIdCookie'];
$query="SELECT * FROM registration WHERE LoginId='$LoginId'";
$result=mysqli_query($dbc,$query) or die('Not Connected');
$row=mysqli_fetch_array($result);
if(isset($_COOKIE['LoginIdCookie']))
{
setcookie('LoginIdCookie',$row['LoginId'],time()-3600);
echo 'Log';
}
else
{
setcookie('AdminCookie','A',time()-3600);
}

//$home_url='http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']).'/LoginValidator.php';
//header('Location: LoginValidator.php');
echo "You are logged out successfully.<br><br>";
echo $LoginId;
//echo "<a href='index1.php'>Back to Home</a>";
require_once('lower.php');
?>

HI friends.........
By above code I m not logged out even it displays "You are logged out successfully".....
After click on back button I can do everything.....
So plz tell me where I am wrong?????
Anyone plzzzzzzzzzz/////

1.check whether control is going to if or else..Keep echos in two conditions.
2.Try to print

$row

value before if condition.
3.print cookie value after else..
4. also try this setcookie('LoginIdCookie',$LoginId,time()-3600);
5.for logout coding why you are checking the id with database(as it is already done in login code).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.