Jump to content

logging out with cookies


pneudralics

Recommended Posts

Everytime I logout and go to the url and type in localhost/logout.php I else statement which I shouldn't get unless I just logged out. I can type in localhost/logout.php all day and it'll show my else statement.

 

But if I refresh the page I'll finally get my error.php. How do I fix it so after I logout and I type in localhost/logout.php it'll show the error page instead of showing that I just logged out.

 

The below is my logout.php

<?php
ob_start();
if(!isset($_COOKIE['id']) && !isset($_COOKIE['idsession']) && !isset($_COOKIE['ip'])){
include ('c/connect.php');
include ('header.php');	
include ('sideleft.php');
?>
<div id="maincolumn">
<?php
require ("error.php");
?>
</div>
<?php    
include ('footer.php');	 
} else { 
include ('c/connect.php');
include ('header.php');
setcookie('id', '');
setcookie('id', '', time() -3600);
setcookie('idsession', '');
setcookie('idsession', '', time() -3600);
setcookie('ip', '');
setcookie('ip', '', time() -3600);
ob_flush();
?>
<?php
include ('sideleft.php');
?>

<div id="maincolumn">
<div class="text">
You have successfully logged out of HappyProfile.com
<br />
Thanks for visiting and come back soon!
<br />
<a href="login.php" style="font-weight:bold;">Log Back In</a>
</div>
</div>
<?php
include ('footer.php');
}//End session else
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.