...

View Full Version : COOKIES / SESSION - Logging out on one computer, not on another



Taylor_1978
02-21-2010, 02:32 AM
Hi,

I seemed to have made a mess of my cookies / sessions for login/logout purposes.

On my desktop, I am able to log out no problem. However on my laptop, it will not log me out.

This is what I have:

login.php


setcookie("USERID",$r['id'],time()+2592000);
$_SESSION['USERID'] = $r['id'];


db.php (included at the top of every page)


if (@!$_COOKIE['USERID'] AND $_SESSION['USERID']!=0) {
if(isset($_SESSION['USERID'])) {
$_COOKIE['USERID'] = $_SESSION['USERID']; // I included this because with only cookies, some people were saying they could not login at all.
}
}



logout.php


setcookie("USERID",""); // I've also tried: setcookie("USERID","",time()-2592000);
unset($_SESSION['USERID']);


EDIT: This issue actually appears to be an IE issue (surprise surprise), although I'm sure it's still due to my coding... I can lout no problem on Firefox on my desktop, but not in IE :(

Any help appreciated! :thumbsup:

Taylor_1978
02-21-2010, 04:29 AM
Okay so I listed this as resolved as I thought I had fixed the problem.

So I added into logout.php session_destroy();

This worked on my desktop... It now logged out correctly in both firefox and IE.. So I thought problem was solved.. but it isn't!

On my laptop - the same problem still occurs... Firefox logs out... IE does not! Both are IE v8. The only difference is desktop is XP and laptop is Vista... which I know that probably makes no difference, but its the only think I know of different between the two! HELP! :(

Taylor_1978
02-21-2010, 08:01 PM
Anyone have a solution/idea?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum