Logout is not working for members app - holds info in cache

  • ~~

    <?php

    include('../pggs2.8.6_update/runtime.php');

    perch_member_log_out();

    PerchUtil::redirect('/members/');


    ~~

    Logout only works if you are using an incognito mode. If you use a regular browser window, it will not logout correctly until you dump the browser cache. Is this a bug? The code I am using is the suggest code from the members app newest version.

  • I had the same problem. I've just checked my code and I've commented out the 'PerchUtil::redirect('/members/');' line and that made it work. Perhaps it is a timing issue and the 'log_out' doesn't have sufficient time to clear out cookies before the PerchUtil redirect comes into effect? My site setup is such that if you're not logged in, you get redirected to the members home page (to log in again) anyway. So, the PerchUtil line isn't really needed.

  • Thought maybe it was just my copy something not uploaded so I uploaded a new members app and I still don't see that at all. No members folder in settings. So what is going wrong with that.

  • This isn't working, we still don't get logout. what can we do to fix this.

    ~~

    <?php

    include('../pggs2.8.6_update/runtime.php');

    //perch_member_remove_tab('members');

    perch_member_log_out();

    echo '<br /><br /><br /><br />';

    //echo'print('session_name()')';

    $_SESSION = array();

    if (isset($_COOKIE[session_name("p_m")])) {setcookie(session_name("p_m"), "", 0);

    echo 'inside if statement' . $_session_name() . ';}

    if (session_status() == PHP_SESSION_ACTIVE) { session_destroy()'; }

    perch_member_logged_in(NULL);

    $page = $_SERVER['PHP_SELF'];

    $sec = "10";

    echo '<a href="https://palam.org">Click for PALAM Homepage</a>';

    ~~

  • Logout only works if you are using an incognito mode. If you use a regular browser window, it will not logout correctly until you dump the browser cache. Is this a bug?


    The fact that it works in incognito mode suggests it is not a bug. Incognito mode gives a fresh session and will still cache and store cookies; it just does not keep them once you close all your incognito browser tabs/windows.


    Have you only tested this in a single browser on a single device? Do you have any browser extensions installed? If you are unsure how to proceed to diagnose this, you can contact a registered developer to assist you with this.