You do not need to rewrite wp_set_auth_cookie()
, it allows you to change the expiration time of the cookie:
add_filter( 'auth_cookie_expiration', 'wpse101378_change_expire_time', 3 );
function wpse101378_change_expire_time( $expire, $user_id, $remember ){
//The $remember variable indicates whether the user has elected
//to be 'remembered'.
//By default, if true, WP sets expire to 14 days if false, 2 days
//$expire is time in seconds
return 24*60*60;
}
If you want to clear the current cookie, you can use wp_clear_auth_cookie()
(see source)
Related Posts:
- How to validate a user from ouside wordpress/php?
- why does WordPress need two cookies for auth/login
- Change GitHub Account username
- Google OAuth 2 authorization – Error: redirect_uri_mismatch
- What are the main differences between JWT and OAuth authentication?
- Automatic WordPress Login of Logged In ClickFunnels User
- How to use OAuth authentication with REST API via CURL commands?
- Override user authentication with external credentials
- JWT authentication with WP – Approach
- Extend WordPress (4.x) session and nonce
- How to use WordPress authentication on non-WordPress page?
- Should wordpress_logged_in cookie exist while logged out?
- Keep Users Logged In As Long As I Like
- How does ifttt.com authenticate a supplied WordPress account
- Storing Dropbox Authentication?
- How to build a plugin that supports authenticated POST requests to the REST API from external servers?
- WordPress as a OAuth Provider
- Authentication/API Questions
- How to transition cookies from .subdomain.domain.com to .domain.com with minimal impact on users?
- Security error WP 4.0 + WP phpBB Bridge [closed]
- Authentication for wordpress website
- How to leverage authentication outside of WordPress?
- How do I execute a wp_remote_get call using NTLM authentication?
- Rest API authentication issue when called from fetch request in bundle.js
- Can’t GET draft posts via REST API from headless frontend
- Outgoing proxy connection problem
- WordPress SSO with MemberPress
- Configuring WordPress Auth Cookie Expiration
- Authenticated request to WP REST API V2 returning 403 error on /users/me [closed]
- How does the “authentication unique keys and salts” feature work?
- Auth cookie value security risk?
- WordPress user Authentication
- WordPress asking for FTP details when installing plugins
- How to password protect media library files (PDF)?
- How to save generated JWT token to cookies on login?
- SSO autologin WordPress + Ajax
- How to use Azure AD for authentication?
- implement authentication and authorization to user
- WordPress authentication cookie and ajax calls
- for a role-protected page, programmatically login user and load page
- After logout browser’s back button into twenty sixteen theme profile
- guest authentication
- wordpress 3.9 remote token auth
- How to set up Shibboleth authentication for a MU site
- Login after “Read More” then return to article
- How to make WordPress use authentication from Parent Site
- How to set a cookie for logged in users to md5($user->ID . “my_secret”)?
- auto logout user when user logout on one of the opened tab
- Detect if authentication is set to “remember” a user being logged on
- How can I have authenticated WordPress users automatically sign into Moodle?
- Requiring Authentication for Parts of WordPress Site
- Can I “protect” a page with a form asking for an email address?
- WooCommerce OAuth 1.0 + JWT authentication with JS/React
- Authenticating users with usermeta fields
- Getting Authentication required popup
- Where is function to prevents non logged users access wp-admin?
- How can LDAP/Active Directory be integrated in WordPress?
- Multiple issues with Ajax login function due to browsers and cookies
- Log in user using WordPress REST API
- Authenticate Subdomain
- How to create new users with JWT Auth Plugin?
- How to verify which WordPress user requested the API in ASP .NET Core?
- Mirgrating a user at signon
- Automate WordPress Login
- Change auth_cookie_expiration for specific roles and specific login times
- Authentication between two different sites using the WordPress login cookie
- Application to Website authentication
- Use WP cookie to authentificate user on an external app
- How to authenticate using JWT by ajax?
- Open authenticed WordPress page from mobile app
- The same session information for peer users on two different WordPress servers
- Access to customer profile with pin code
- Extend Cookie with auth_cookie_expiration not working
- WP link for reset password is not received
- is_user_logged_in() returns different values on different pages
- Why does WordPress use cookies for /wp-admin and /wp-content/plugins for non-admin users [duplicate]
- How to make an other web app can login with wordpress authentication?
- Cookie is not set
- Logged In cookie gets saved but not Auth cookie
- Opening protected page with cookie?
- How to add additional factor to wordpress authentication
- Adding a “Sign In/My Account” link to an external app
- Check if user is logged in, inside php file in template directory
- Connect my WordPress site users to my public site account without showing my public site credentials
- WordPress Multisite and site speed and scaleability
- Blocking the direct access to images in the upload folder WordPress
- Rest Api WordPress
- Can you pass user/pass for HTTP Basic Authentication in URL parameters?
- What is the difference between authentication and authorization?
- WordPress Network / Multisite login to one site allow access to all
- wp_signon by user’s login by their particular role
- jQuery $.cookie is not a function
- How can I block doubleclick.net cookie from my wordpress website?
- WP REST API: check if user is logged in
- How to run a function in every page, every device
- authenticate user without redirecting
- How to allow access based on the user meta flag
- Language switcher for subdomains
- Create Mashable Follow-like Facebook, Twitter login/connect?
- wordpress rest api authentication failed