Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2003
    Location
    Australia
    Posts
    528
    Thanks
    8
    Thanked 8 Times in 8 Posts

    COOKIES / SESSION - Logging out on one computer, not on another

    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
    PHP Code:
    setcookie("USERID",$r['id'],time()+2592000);
    $_SESSION['USERID'] = $r['id']; 
    db.php (included at the top of every page)
    PHP Code:
    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
    PHP Code:
    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!
    Last edited by Taylor_1978; 02-21-2010 at 07:03 AM.

  • #2
    Regular Coder
    Join Date
    Jun 2003
    Location
    Australia
    Posts
    528
    Thanks
    8
    Thanked 8 Times in 8 Posts
    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!
    Last edited by Taylor_1978; 02-21-2010 at 07:06 AM.

  • #3
    Regular Coder
    Join Date
    Jun 2003
    Location
    Australia
    Posts
    528
    Thanks
    8
    Thanked 8 Times in 8 Posts
    Anyone have a solution/idea?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •