Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [logout]

The tag has no usage guidance.

11
votes
1answer
11k views

How reduce wordpress login session timeout time?

I want to logout user autometically when user is idle for more than 10 minutes.That mean suppose user is logged in to a site and user didn't browse any pages for more than 10 mins.when he browse any ...
10
votes
3answers
50k views

How to log out without confirmation 'Do you really want to log out?"?

Right now when I log out via: <a href="<?php bloginfo('url'); ?>/wp-login.php?action=logout">Log out</a> it redirects me to the page where I need to confirm the log out. How to ...
5
votes
1answer
9k views

Destroy user sessions based on user ID

I want to programatically log a specific user out of our WordPress system based on their user ID much like the 'Log Out of All Sessions' button in the WordPress user editor section. How am I able to ...
5
votes
4answers
9k views

Logout redirect to current page - function

I'm looking for a function that can redirect users when they logout to the current page. I'm looking for a code I can use in functions.php?
5
votes
4answers
9k views

How to change the default logout link on WordPress Admin

I want to use another link for logout because I have /wp-admin/* protected with htpassword. Is there a way to do this? Something like creating a custom page like site.com/logout then use it as my new ...
4
votes
3answers
1k views

Change “You are now logged out” text

I want to wrap <strong></strong> around the words "logged out": add_filter( 'gettext', 'wpse17709_gettext', 10, 2 ); function wpse17709_gettext( $custom_translation, $login_texts ) { ...
4
votes
2answers
339 views

Logout URL performing strange

When I enter url : http://www.example.com/wp-login.php?action=logout it asks if you want to log out or not ? why does it happen where I am not logged in as a admin? If I run this url on any ...
4
votes
1answer
5k views

Masking logout URL

The primary goal is to hide that the site is driven by wordpress. I've got the login part all locked up, but the logout URL still has those blasted wp delineators that give away it's a wordpress site. ...
4
votes
1answer
2k views

handling login/logout redirects

I have a couple issues with the way Wordpress handles redirects on login and logout. Standard behaviour is: login: /wp-login.php (with no redirect_to url) -> /wp-admin.php logout: /wp-admin.php -...
4
votes
1answer
2k views

WordPress failure when logging out

I have came across the WordPress logout error several times but I really never figured out the cause of it. In earlier days, it was generally that I was missing a nonce but now even with logout link ...
4
votes
1answer
1k views

Logout/login redirect CSS issue

I'm using WordPress Multisite. When I use wp_logout_url(), I get redirected to the login page but somehow I end at a different login page without any styles applied <a href="<?php echo ...
3
votes
4answers
3k views

How change wordpress password without logout ( need for plugin )

I need change WP password without logout profile. When I use wp_set_password( $password, $user_ID ) i have problem with logout.
3
votes
1answer
6k views

wp_logout Not Logging Me Out

Here is what I'm doing: wp_logout(); var_dump(is_user_logged_in()); var_dump returns: bool(true) Why is wp_logout() not logging me out?
3
votes
1answer
2k views

How to log out everywhere else, destroy all sessions “all other devices”?

WordPress panel service "log out everywhere else" is doing a nice job. I want to use this as a function outside the panel. Screenshoot
3
votes
1answer
575 views

Add a logout menu link [duplicate]

How can I add a logout link in my websites menu? Is there a PHP code or link that I can use to be able to do this? Thanks
3
votes
1answer
5k views

Clearing cookie on logout and session expiration

I would like to clear the session cookie when a user logs out or when their session expires. I understand that wp_clear_auth_cookie(); clears the cookie but I am struggling to understand how to ...
3
votes
1answer
1k views

Get wp_logout_url function to work on external (non-Wordpress) page

I have blog and forum, and I need to put wordpress external logout link. What files do I need to add to make wp_logout_url(); work? Thank you.
2
votes
2answers
2k views

wp_nav_menu log in/out link?

I have a wp_nav_menu showing pages, but I'd also like to include a log in/out link, based on the current state of the user, which will redirect them to the home page. I've looked far and wide, but ...
2
votes
2answers
12k views

Logout redirect to home page

I'm using custom menu for login/logout here below is my code: <li> <?php if (is_user_logged_in()) { $user = wp_get_current_user(); echo 'Welcome <strong><a href="http://...
2
votes
2answers
383 views

Logout via Subdomain, non-wordpress page on a different server?

Similar to the question over at Get wp_logout_url function to work on external (non-Wordpress) page The problem I am facing is the fact the subdomain is on a different server so I am unable to ...
2
votes
1answer
1k views

Logout issue with new Domain on WP Multisite

I'm using a multisite and I set my site up at parentsite.com/mysite. When the logout button was clicked it worked correctly and logged the users out and brought them back to the homepage. Here's what ...
2
votes
3answers
3k views

I keep getting logged out in Firefox

For some reason, tonight when I have gone to work on my Wordpress installation I firstly found myself logged out, even though there was a few cookies left in Firefox relating to the website and when ...
2
votes
1answer
4k views

how to logout user on browser tab or window closes

How to logout a user when he closes the tab/window ? If no, it is possible to clear the session after specific time? How to do that?
2
votes
1answer
48 views

wp_logout() changes in WordPress 5.1.1

We've recently just upgraded our WordPress site to 5.1.1 After the upgrade, we've started encountering issues when executing the wp_logout() function of WordPress. Somehow we're getting a 302 ...
2
votes
2answers
4k views

Wordpress Nonce Issue for Ajax Login and Logout

I am using ajax to submit log in and log out credentials. The log in and log out forms are replaced with html returned by a successful response. No page loading is happening page content is loaded via ...
2
votes
2answers
2k views

wp_logout action not working

I'm trying to remove some cookies set to control persistent login when the user specifically wants to log out of a website. I thought it would be as simple as: function remove_user_cookie() { ...
2
votes
1answer
2k views

Custom Connect to Facebook, problem logging in/logging out

I am working on a custom function for login in my users via facebook. I started by reading this nice tutorial on how to login in via facebook: http://digitalzoomstudio.net/2013/02/09/tutorial-how-to-...
2
votes
1answer
27k views

Logout user and delete cookies from the client side?

I'd like to be able to logout the user. I can do this by calling wp_logout() on the server but if the user drops connection is there a way to log them out? The wp_logout() method clears the cookies. ...
1
vote
2answers
3k views

share login/logout sessions across two installs?

I'm having some issues sharing the user sessions across two installs. (a) site on http://stolenmx.com (b) site on http://arcade.stolenmx.com I have installed B in the same database as A and I have ...
1
vote
2answers
212 views

Is there any way to check for user login and send him to login?

I have written a plugin for my own site where I have an issue like "after user login to the site if he logout then again if he clicks on browser back button then the previous page showing again ...
1
vote
2answers
1k views

wp_logout not redirecting using wp_logout_url() and wp_redirect()

I have written this function for loggin user out. The user is loggin out but not redirecting to the page instead goes to home page which default logout Url. i have tried wp_logout_url() and also ...
1
vote
2answers
3k views

Deleting cookie to logout

Would be potential problems if I delete wordpress_logged_in_47d1523b... cookie using javascript? Is there something additional that wp_logout does?
1
vote
1answer
1k views

Preexisting login to change to logout link in sub menu

I am using twenty twelve with a child theme. I have a link in my primary nav menu where I have an link for “My Account” which has a sub menu with a “Login/Register” link that redirects to a modified ...
1
vote
3answers
11k views

Redirect user after logout

I am trying to create an unsubscribe page for my members, but in order to see the unsubscribe form, they have to be logged out, so the first link is: /wp-login.php?action=logout&_wpnonce=...
1
vote
2answers
2k views

Ajax function returns -1

I have a question. I made a simply ajax function. When I'm logged in, it works perfectly. When I'm logged out, it returns me -1 (since Wordpress 3.1) Why ? I don't understand. Precisely, it returns -...
1
vote
1answer
1k views

How long do users stay logged in if they DON'T check remember me?

As the title states, I'm wondering how long users stay logged in if they don't check the "Remember Me" option. I've heard that if they DO check it, it keeps them logged in for 14 days. But what if ...
1
vote
2answers
10k views

How do you log a user out with wp_logout?

I can get wp_logout to work, but not without generating lots of warnings ('PHP warning: Cannot modify header information - headers already sent'). wp_logout calls wp_clear_auth_cookie, which calls ...
1
vote
1answer
293 views

Wordpress custom login page

I found a little article on how to create a custom Wordpress Login page and I am wondering if this technique/practice is safe to use? The article: http://blog.caercam.org/2012/09/21/wordpress-login-...
1
vote
1answer
1k views

wp_logout_url redirects to incorrect page because of pagination

Following a Wordpress Pagination tutorial, wp_logout_url( get_permalink() ); no longer redirects to the correct page. Instead of redirecting to say domain.com/page/2/, it redirects me to one of the ...
1
vote
3answers
3k views

add logout button on admin side menu

I want to add a logout button on the side admin menu (because I disable the admin bar for the users). So I thought add_menu_page() is the way to do it, but how to add the link to the regarded function?...
1
vote
2answers
373 views

Logout redirects to /forums/

A while back I installed a plugin which, upon logout, re-directed users to /forums/. Unfortunately, I have no idea which plugin that was and whether or not it's still active/installed. What code/db ...
1
vote
1answer
144 views

How would I hook into `clear_auth_cookie` to return the user's ID that's currently being logged out?

clear_auth_cookie is what I'd need in order to catch the actual logout action, but I can't get it to return anything. https://core.trac.wordpress.org/browser/tags/4.9/src/wp-includes/pluggable.php#...
1
vote
1answer
2k views

Logout using link (without nonce)

This question comes from an absolute non-coder - and has been asked in various forms several times befor (e.g. here). To logout properly the URL that triggers it needs a nonce as e.g.: http://xyz/...
1
vote
1answer
77 views

Disconnect automattically after X minutes

I recently discovered that if I don't disconnect myself from WordPress, my session could last for more than a day. I wondered what could I do to set a maximum time of inactivity on the site, after ...
1
vote
1answer
822 views

What is difference between logout and switch off?

What is the difference between logout and switch off in wordpress 3.6 except below? 1.Logut - redirect to login screen of admin. 2.Switchoff - redirect to UI side.
1
vote
1answer
573 views

How to: PHP Log Out Link?

I originally came here to find help on creating a string of text that would display a login link, and when the user was logged in it would should their username. Travis Pflanz had the answer for ...
1
vote
1answer
140 views

do_action appearing outside of menu?

I'm using Bill Erickson's "Add Extra Code to Any Menu" function: <?php /** * Add Extra Code to Any Menu * @author Bill Erickson * @link http://www.billerickson.net/customizing-wordpress-menus/ ...
1
vote
1answer
3k views

Login/logout in header

I am looking to move the login / logout / my account / register details currently situated under my menu bar to above the menu bar. Essentially I want to add the details just after the header. What ...
1
vote
1answer
192 views

Update user meta on logout

I have seen some answers, but the questions are quite a number of years old, and the after trying their responses I've not been able to get it to work. I need to update user meta data during the ...
1
vote
1answer
644 views

After logout browser's back button into twenty sixteen theme profile

I have tried numerous ways to prevent the browser's back button from allowing someone from using it to go back into a visitors logged out profile. The codes I used were supposed to prevent the browser ...