Stack Exchange Network

Stack Exchange network consists of 174 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.

0
votes
0answers
11 views

Login/Logout Button Filter [closed]

I have the following code to add a login/logout filter in the WP Nav Menu: <?php add_filter( 'wp_nav_menu_items', 'ia_custom_menu_item', 10, 2 ); function ia_custom_menu_item ( $items, $args ) { ...
0
votes
1answer
15 views

How do I replace “Log Out” from the Menu with “My Orders”?

After the user clicks on Log In, the Log In option changes to Log Out in the menu. How can I make it change to My Orders instead, redirecting to /my-account/orders/? So basically now it's changing ...
-1
votes
0answers
20 views

logout user after payment or close the browser

I used this code in the wordpress functions.php, to logout user after payment or close the browser /** * Bypass logout confirmation. */ function iconic_bypass_logout_confirmation() { global $wp;...
0
votes
0answers
69 views

wp_logout() not working after form submission

I am pretty new to Wordpress, so please forgive me if this sounds like a silly question. I have a Wordpress Page which is using the default page.php template in my theme. I modified the page.php ...
0
votes
0answers
24 views

Wordpress Login and Logout issue (Bitnami)

I was having problem with hostgator hosting service so I am trying to move my website to google cloud platform. I installed a wordpress website (Bitnami) and there is an issue I don't understand. ...
1
vote
1answer
84 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#...
0
votes
1answer
157 views

Logout redirects to default page

New to wordpress and not a php developer, but I'm currently having an issue with a user being redirected to a default wordpress page and being asked to confirm if the user wants to log out twice. I ...
3
votes
1answer
1k 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
0
votes
0answers
636 views

Changing the WP login session cookie time?

As i know, WordPress makes login session cookie expire in 48 hours or on browser close. And in 14 days, if we check the "Remember Me". I want to change this time to 5 seconds: function ...
0
votes
0answers
103 views

Logout user in WP if the tab is closed

How to automatic logout user (even you are admin) if the tab is closed in WordPress? Important: Clearing the session after specific time is not appropriate solution. Thank you.
0
votes
0answers
17 views

WordPress kicks me out of admin panel after publishing a post or uploading an image

I configured a website based on WordPress. Every time i publish a post or upload an image i get logged out of admin panel and can not login again; I can login only if i close the window and then login ...
0
votes
1answer
355 views

How to Show Different Menus to Logged in Users in WordPress [duplicate]

how to write code for this requirement and i want to show menus only in header menu with different menus to logged users
0
votes
1answer
72 views

add the user name to menu when user is logged in [closed]

i have this code but its not working it throws syntax error, unexpected '}' error function my_custom_menu_item($items, $args) { if(is_user_logged_in() && $args->theme_location == '...
0
votes
1answer
121 views

Why deleting/removing cookies in WordPress does not log me out from admin?

I am really curious and I haven't found satisfactory answer in similar questions. When deleting all of my cookies, I am still perfectly able to access my admin dashboard - why am I not returned back ...
0
votes
1answer
1k views

Logout Redirect and also WP-login.php Redirect

I am not very advanced in php. I have this function that prevents wp-login.php access with redirection add_action('init','custom_login'); function custom_login(){ global $pagenow; if( 'wp-login.php' ...
1
vote
1answer
155 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 ...
0
votes
1answer
70 views

Redirection of wp-login.php results in non working of Logout process

I want to create Custom Login, Registration, Password Reset & Logout Page. For that I have added following code in my function.php file. function custom_login_page() { $new_login_page_url = ...
0
votes
1answer
56 views

WordPress session times out - but doesn't log out?

Since migrating our WordPress site to a new webserver, we have had issues where users are apparently getting logged out...but yet aren't. What I mean is, on our old server, users would sometimes get ...
0
votes
0answers
34 views

wp_logout_url($uri) having two redirect values

$uri= $_SERVER['REQUEST_URI']; wp_logout_url($uri) having two redirect values like this http://localhost/sarkari/wp-login.php?action=logout&redirect_to=%2Fsarkari%2F&_wpnonce=b5e3b954df&...
1
vote
1answer
563 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 ...
0
votes
1answer
494 views

How to ristrict browser back button after logout?

I'm facing a issue from couple of days, after logout user can view the login user history details using browser back button, so how could I resolve this issue. Could you suggest me to solve this issue ...
0
votes
1answer
566 views

wp_logout problem

I have added custom page '/member-logout/' in nav walker for user logout. When activated then the function 'render-logout' is fired function render_logout() { if ( is_user_logged_in() ){ ...
0
votes
0answers
484 views

Wordpress Logout Failure

We recently started experiencing an issue in 4.7 where admin can't logout. We added this fix as it was the only one that works. However we are getting a blank page as it is not redirecting to home url....
0
votes
2answers
1k views

how to refresh page after user logout with 'wp_logout_url'?

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
202 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
1answer
1k 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
2answers
960 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 ...
0
votes
0answers
297 views

Wordpress Ajax Logout

I am trying to upgrade one plugin. Can someone help me with creating a seamless logout procedure from wordpress? I want a logged in user to click on a link/button in a widget in sidebar. This link ...
0
votes
1answer
398 views

login logout menu changes in wordpress [closed]

I am new to wordpress ,i use login and logout in my site,i already create pages for login , logout and register ,i wants to create 2 menu in navigation bar . one for register and another one for login ...
0
votes
1answer
99 views

get_permalink not fetching correct pages

I am developing a WP site locally on Xampp. I am using the following code to add a styled login/out button to the sidebar: add_shortcode( 'my_login', 'my_login' ); function my_login() { if (...
0
votes
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?
2
votes
2answers
354 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 ...
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 ) { ...
1
vote
1answer
76 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 ...
0
votes
2answers
2k views

Use wp_logout_url() in menu creation page

can anyone give me some idea about how I can use the value of wp_logout_url() within the menu creator page of wordpress? As the menu creation page doesn't support php I cannot just put echo ...
3
votes
1answer
527 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
0
votes
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 ...
0
votes
2answers
648 views

Conditional redirection with logout

I've been asked to implement a custom redirection in WordPress. It seemed quite simple at first but I have no idea how to get it right. So much that I can't even get started with it. This is how it ...
0
votes
1answer
119 views

Custom, conditional redirect on logout

I'd like to implement a custom logout function that only runs if the conditions are met. Instead it returns me to the homepage whether the conditions are true or not. Here's the code that should do ...
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.
1
vote
2answers
9k 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 ...
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 ...
1
vote
2answers
2k 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 ...
0
votes
2answers
1k views

Set Short Automatic Logout Time for One User

I am building sites where I secretly give authoring role capability to visitors by auto-logging them into a generic account; they never see the admin bar, and are prevented from seeing the dashboard (...
4
votes
2answers
299 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 ...
2
votes
2answers
3k 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 ...
0
votes
0answers
294 views

Logging back into WordPress after logging out and having issues with 'loggedout=true' in redirect URL

I have custom login form that displays a logout link after a user has logged in. I'm running into an issue when clicking log out. Wordpress redirects the user to a url with the parameter loggedout=...
0
votes
1answer
2k views

wp_logout_url($redirect); is not working in wordpress

I am writing a simple WP plugin that could log the user in and out. As far as login is concerned its working good but I cannot log out, through my plugin. Logout doesn't work after I login. I have ...
0
votes
3answers
864 views

Wordpress Login/Logout Single Menu Only

I've written this login/logout for my functions.php in my wordpress theme. The problem is, it's showing a login/logout link in all menus both primary and secondary. Is there a way to get it to ...
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() { ...