Forum

Thread tagged as: Problem, Members

Members app, logout not working

Hi, I have a logout page with the following code...

<?php 
    include('../cms/runtime.php');
    perch_member_log_out(); 
    PerchUtil::redirect('/users/');
?>

...but members aren't being logged out and the redirect isn't working. It's only when I hit the refresh that the member is logged out? The same thing is happening to any pages that use...

<?php if (perch_member_logged_in()) { ?>
<?php } else { ?>
<?php } ?>

Any assistance would be appreciated!

Jon H

Jon H 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Do you get any errors or anything like that?

I ran into this exact same problem.

The issue was with text/html HTTP caching in the .htaccess file. After removing HTTP Caching users can once again logout without refreshing the redirect page.