WordPress.org

Ready to get started?Download WordPress

Forums

Logging out, and browser cache (9 posts)

  1. tom92024
    Member
    Posted 2 years ago #

    Sorry if this has been asked (and answered) elsewhere, but I haven't been able to find it.

    I created a WordPress site for a client that's "for members only," containing some sensitive content. Everything's working fine, and all's well, with the exception of logging-out.

    I'm using wp_logout_url("http://somewhere.else")to get the visitor out of the site, and redirect them to a public page, which works fine, however, the "for members only" site remains in the browser cache, so even though the logout & redirect were successful, you can hit the "back" button in the browser, and see the last "private" thing the member was viewing.

    Of course, a page reload fixes that (I'm routed-back to the login screen correctly on reload), but if the member is on a public computer (internet cafe, or what have you), it's bad news, for sure (this is very confidential information).

    I'm trying to build all of this without modifying the WordPress core, or any of the "off-the-shelf" plugins, however, it is a custom theme, and I can implement anything at that level.

    Thanks in advance for any help!

  2. kmessinger
    Volunteer Moderator
    Posted 2 years ago #

    This is on the front side correct? They are not logging into the dashboard.

  3. tom92024
    Member
    Posted 2 years ago #

    Correct.... I'm using a plugin (WP Block Admin) to hide the admin bar from the regular users, so all they're ever seeing is the front side.

  4. kmessinger
    Volunteer Moderator
    Posted 2 years ago #

    If they are truly logged in to the back-side but can't see it then the normal wp logout should work. Maybe link a logout button to http://yoursite.com/wp-login.php?action=logout&_wpnonce=1b8ea328d0

    The wp logout clears the cache as it goes as the back button just leads back to the sign-on page.

  5. tom92024
    Member
    Posted 2 years ago #

    I've tried that, and it presents a couple of problems (in this case)...

    First, it stops on an "are you sure you want to logout?" page (which most users ignore, or never see if they're thinking the click logged them out), and it doesn't support the auto redirect to an external URL (a requirement for this project).

    I just keep thinking (maybe I shouldn't be <smile>) that there should be a wp_logout_url() argument that provides that same functionality, but I keep coming up empty.

  6. kmessinger
    Volunteer Moderator
    Posted 2 years ago #

    First, it stops on an "are you sure you want to logout?" page

    I have never seen that page. Could it be a theme thing?

    Check http://codex.wordpress.org/Function_Reference/wp_logout_url#Logout_and_Redirect_to_Another_Site

  7. tom92024
    Member
    Posted 2 years ago #

    It causes WordPress to generate the "WordPress Failure Notice" page. That's a part of the WordPress core (I found it around line 2726 in /wp-includes/functions.php).

    The comments indicate that it's supposed to display the "Are You Sure?" message.

  8. kmessinger
    Volunteer Moderator
    Posted 2 years ago #

    This is what I found. 'You are attempting to log out of %s' ), get_bloginfo( 'sitename' and with a child theme you should be able to get rid of that pretty easily. BTW for me the comment started on line 1911 but I am using a 3.4 beta - still I find that a little strange.

  9. wpinklady
    Member
    Posted 1 year ago #

    I have been searching the answer of this issue days and days, but got nothing to fix it. Can anyone if you know how to get rid of this "WordPress Failure Notice" page, please let me know. I tried some suggestions from other places, but this page still show up. Very frustrate. Please help!! Thank you so much.

Topic Closed

This topic has been closed to new replies.

About this Topic