The wp_generate_auth_cookie()
function is a pluggable function, meaning you can define a function with the same name in a plugin and your version will be used instead of the WordPress core function.
The number of pluggable functions is limited, however. If you want a broad solution that works for all cookies, your lower-level Lua approach will be a better option.
Related Posts:
- How to share cookies and sessions between domain and subdomain?
- Is it possible to transfer a WordPress session to a different browser via query string?
- Disconnect automattically after X minutes
- Do I need a Cookie consent on a basic WordPress site?
- Correct user session/cookie handling with external site connection in wordpress
- Looking to load a different template part on every load/refresh
- Capture and display users name
- WordPress keep logged in after browser close
- Cookies vs. sessions
- How do I expire a PHP session after 30 minutes?
- PHP – setcookie(); not working
- Removing username from the ‘wordpress_logged_in’ cookie
- How does REST API cookie authentication work in WP 4.7?
- Place a cookie when a specific page has been viewed?
- How to detect a user that is not logged in
- How to change cookie name
- Using wp_set_auth_cookie for custom user account system
- Should wordpress_logged_in cookie exist while logged out?
- Clearing cookie on logout and session expiration
- WP_Http_Cookie destroys cookie value through urldecode()
- Display message once per session to users with a specific role
- Worpdress PHPSESSID / EU law
- Get restrict content by submitting Gravity Forms
- Website Loads Twice Unnecessarily
- Do I use cookies?
- Hide/Show content based on cookie
- $_SESSION variables lost during OAuth callback
- ERROR: Cookies are blocked or not supported by your browser
- Can WordPress store comment cookies on two different computers?
- How to get login data (session) outside WordPress?
- Serving Cookies From A Different Domain or Sub-Domain
- Random popup image per user with no repeat
- How to get session token of current user in wp_login hook?
- Deleting cookie to logout
- Show greetings on first time visitors?
- Unset a Cookie on Successful Gravity Forms form Submission [closed]
- How set a cookie from PHP and get it without refresh
- Why wordpress cookies name contains HASH
- Cookie only detected when visitor is logged in
- Change the user is logged in cookie name
- can we share user login in 2 wordpress installs in 2 subdomains on one server? [duplicate]
- background/font size change and remember
- Modifying request $_COOKIE
- How to implement a $_SESSION alternative in WordPress inside a theme without a plugin?
- Block google maps from loading until user agrees to cookies with Elementor
- WordPress Keeps Logging Out – What Tests Can I Run to Solve This?
- User Session and Stored Cookies not get removed
- Need help setting cookies with multiple value [closed]
- 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
- How to setup cookie free domain for wp-includes?
- WordPress authentication cookie and ajax calls
- COOKIE_ID with username appended
- iframe does not store session/cookie when refresh parent
- Setting Cookies For Form Autofill
- What are your thoughts on overriding the PHP builtin setcookie() function to control whether or not WP creates cookies
- Issues with set cookie
- Accept or deny cookies – how to?
- How to set a Cookie-Free Domain with WordPress?
- Is it possible to use cookie-free domains in WordPress?
- Passing cookies when using wp_remote_get
- Set Short Automatic Logout Time for One User
- WordPress Post Voting – Vote once per IP on entire site
- wordpress can’t read a cookie?
- Set cookie with taxonomy name
- Where is function to prevents non logged users access wp-admin?
- Best method to show modal only once
- Cookie with referral URL [closed]
- Error when setting cookie
- How to keep a variable in COOKIE or GET query string?
- Cookie Details Requested
- Add session or cookie to remember last menu location
- Authorize subdomain to access and read user and admin cookies
- Cookie error. No possibility to define my cookie
- Set cookie parameters on wp site – PHP not working?
- can you help review CCCP (Conditional Cookie Content Post) and help to create a block?
- COOKIE_DOMAIN chaos
- Setup cookie on Chrome even without HTTPS
- PHP cookie control does not work correctly
- Setting a Custom Cookie in WordPress only for Logged In Customer/User (non-admin)
- How are sites using wordpress hiding wordpress cookies that have “wp” or “wordpress” in the cookie name?
- Login issue with subdomain installs
- Get WordPress logged in username from root domain when WP is installed in a subfolder
- Checking for cookies returns correct result only inside Elementor Editor
- How to save history in the client’s browser without login? [closed]
- Automatically Log Out UserX when visiting WooCommerceStore
- Entirely Cookieless WordPress?
- Use WP user status (logged_in) to manage access to independent application
- is_user_logged_in() returns different values on different pages
- how to remember specific action/event for current user?
- When ever wordpress home page refreshes the code is not reading the cookie as set anymore
- http_referrer issue when detecting where site comes from and allow if from allowed host
- detect referr page
- Allow user to select location and then set cookie for location in WordPress
- Cookie is not set
- Why isn’t my cookie setting in my function?
- Logged In cookie gets saved but not Auth cookie
- set cookies or let system know a user has been on site
- Why WordPress not logout after I have close my browser?
- How to use Cookie or Session php for one page and just a password