Try setting $experation
to a negative integer:
function myplugin_cookie_expiration( $expiration, $user_id, $remember ) {
return $remember ? $expiration : -600;
}
add_filter( 'auth_cookie_expiration', 'myplugin_cookie_expiration', 99, 3 );
From the w3schools PHP page on cookies:
<?php
// set the expiration date to one hour ago
setcookie("user", "", time()-3600);
?>
Related Posts:
- Disconnect automattically after X minutes
- WordPress Keeps Logging Out – What Tests Can I Run to Solve This?
- Cookies vs. sessions
- How do I expire a PHP session after 30 minutes?
- How to log out without confirmation ‘Do you really want to log out?”?
- How reduce wordpress login session timeout time?
- Removing username from the ‘wordpress_logged_in’ cookie
- How to share cookies and sessions between domain and subdomain?
- Destroy user sessions based on user ID
- Is it possible to transfer a WordPress session to a different browser via query string?
- How change wordpress password without logout ( need for plugin )
- Logout URL performing strange
- Display message once per session to users with a specific role
- How to log out everywhere else, destroy all sessions “all other devices”?
- share login/logout sessions across two installs?
- wp_logout Not Logging Me Out
- wp_logout action not working
- Get wp_logout_url function to work on external (non-WordPress) page
- WordPress failure when logging out
- $_SESSION variables lost during OAuth callback
- How to get login data (session) outside WordPress?
- wp_logout() changes in WordPress 5.1.1
- how to logout user on browser tab or window closes
- Custom Connect to Facebook, problem logging in/logging out
- Logout user and delete cookies from the client side?
- Random popup image per user with no repeat
- How to get session token of current user in wp_login hook?
- wp_logout not redirecting using wp_logout_url() and wp_redirect()
- Deleting cookie to logout
- Logout using link (without nonce)
- Logout redirects to /forums/
- What is difference between logout and switch off?
- How to implement a $_SESSION alternative in WordPress inside a theme without a plugin?
- User Session and Stored Cookies not get removed
- Session Experies and Get Logged Out Within Few Minutes
- How to store post ID’s in cookie or session to display the same posts later
- Check if user is logged in to site A when visiting site B
- After logout browser’s back button into twenty sixteen theme profile
- iframe does not store session/cookie when refresh parent
- Disallow second login session
- Set Short Automatic Logout Time for One User
- Session Cookie security questions
- How to change WordPress cookies to be session-only
- $_SESSION variable not saving on page refresh or new page
- Where is function to prevents non logged users access wp-admin?
- LogOut button only if logged in in front end menu widget
- One time login on 2 different WordPress sites
- Error when setting cookie
- wp_logout_url($redirect) won’t logout and redirect ()
- Add session or cookie to remember last menu location
- Authorize subdomain to access and read user and admin cookies
- Codeless random token generation to pass into multiple tracking links in a single page load
- add class to element if user is not logged in [closed]
- Set cookie parameters on wp site – PHP not working?
- logout users with specific role after close browser tab
- Change auth_cookie_expiration for specific roles and specific login times
- How to hide “You are now logged out” message on WordPress login form?
- Correct user session/cookie handling with external site connection in wordpress
- Login issue with subdomain installs
- logout error “something went wrong”
- Get WordPress logged in username from root domain when WP is installed in a subfolder
- Logout all users at particular time
- What is the link to log out on WordPress?
- Automatically Log Out UserX when visiting WooCommerceStore
- How do I replace “Log Out” from the Menu with “My Orders”?
- Use WP user status (logged_in) to manage access to independent application
- how to remember specific action/event for current user?
- Why deleting/removing cookies in WordPress does not log me out from admin?
- Redirection of wp-login.php results in non working of Logout process
- Looking to load a different template part on every load/refresh
- wp_logout_url($uri) having two redirect values
- Allow user to select location and then set cookie for location in WordPress
- Capture and display users name
- wp_logout problem
- Why WordPress not logout after I have close my browser?
- WP Logs me out after updating anything on dashboard
- How to restrict browser back button after logout?
- how to manage Session in WordPress using custom login?
- WordPress keep logged in after browser close
- How to invalidate wordpress_logged_in cookie via backchannel logout
- How to delete a cookie?
- PHP 7.2 – Warning: count(): Parameter must be an array or an object that implements Countable
- Set cookie and get cookie with JavaScript
- Form submission: PHP S_SESSION statements within a foreach loop
- S_SESSION variable (user role) not recognised
- Sticky and NON-Sticky sessions
- Where does Chrome store cookies?
- What is PHPSESSID?
- ASP.NET Why are sessions timing out, sessionstate timeout set
- How to fix org.hibernate.LazyInitializationException – could not initialize proxy – no Session
- javascript set cookie with expire time
- What are sessions? How do they work?
- display variable image using cookies
- jQuery $.cookie is not a function
- Session timeout in ASP.NET
- How do I set/unset a cookie with jQuery?
- How to use cURL to send Cookies?
- “Cannot send session cache limiter – headers already sent”
- Make Axios send cookies in its requests automatically
- How to declare session variable in C#?