PHP Scripting Forums » PHP Classes Support Forum » Access_user Class Support forum

Access User Class and destroying the cookie

(4 posts)

Tags:

Please support us by buying these products:

  1. User has not uploaded an avatar

    fergalfrog
    Member

    Hi Olaf,

    Nice work on the access user class. Just a quick question/comment.

    In the access user class should the cookie not get unset/expired in the logout method. In some testing I found if 'remember login' is true and the cookie is set it is not possible to log out (IE 7 anyway).

    I didn't see anything in the file to unset the cookie. Thus I have added some code to expire the cookie in the logout method and all behaves as expected.

    Thanks,
    fergalfrog

    Posted 1 year ago #
  2. Hello,

    I know about this and was to busy in the past to fix that, because you're the second who pointed me on that I will change this very soon (I hope)

    this should be some solution:

    function log_out() {
       $this->save_login = "no";
       $this->login_saver();
       unset($_SESSION['user']);
       unset($_SESSION['pw']);
       unset($_SESSION['logged_in']);
       session_destroy(); // new in version 1.92
       header("Location: ".LOGOUT_PAGE);
       exit;
    }
    Posted 1 year ago #
  3. User has not uploaded an avatar

    fergalfrog
    Member

    No problem - thanks for the quick response - that is pretty much what I did.

    I have also made another slight modification to the loginsaver method which others may want to consider:

    } else {
        $expire = time()+$lifetime;
    }

    $lifetime can be defined in the config file or by the user on login (is a user wants to set how long they should be logged in)

    Posted 1 year ago #
  4. ... actually I removed the login saver on most of the websites anyway nice function, thanks

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.