looks like I needed add a path to my cookie. This fixed it:
$timer = time()+86400;
setcookie('alertuser', '1', $timer, "https://wordpress.stackexchange.com/");
and
$timer = time()-86400;
setcookie('alertuser', '', $timer, "https://wordpress.stackexchange.com/");
Related Posts:
- How to resolve error “Cookies are blocked due to unexpected output.”?
- Using a nonce in a Custom Login Form
- I can’t log into my website , it says “Error: Cookies are blocked due to unexpected output”
- What is PHPSESSID?
- Adding “Remember Me” in custom login
- How to change the wp-login.php page title?
- How to set custom cookies before output
- How build a custom login/register form with error handling?
- Check if user already visited this post today
- Display message once per session to users with a specific role
- Using Cookie Data For WP_Query Loop
- WordPress 4 invalid username special charachters issue
- How to turn off redirection from ‘domain.com/login’ to ‘domain.com/wp-login.php’
- Constructing a custom login form using ajax
- automated tests as a user?
- Remove username in emails or swap username for email
- woocommerce and is_user_logged_in() if not redirect to homepage
- Check if user is logged in when clicking certain links on certain pages
- WordPress shows registration link for non logged users
- Creating login session via CURL
- How to sanitize my cookie name
- Recovering WP Login Credintials in Code?
- Is it necessary to sanitize wp_set_password user input?
- Setting a cookie upon specific URL visit
- WordPress custom login form using Ajax
- How to give new users two specific user role options upon WordPress user registration
- How to Highlight unread WordPress posts?
- Wp-login appears White Screen, Error: Cannot modify header information
- Login/logout in header
- How to combine wordpress_logged_in cookies in one cookie?
- Programmatic Login from 3rd Party site
- Cannot access wp-admin/wp-login.php (WordPress backend) anymore, what could be wrong?
- How to debug my custom login form looping intermittently
- getting logged in user info (wp-load.php) from parent directory
- iframe does not store session/cookie when refresh parent
- Login to wordpress by clicking a link and specifying usernaname and password in url
- Insert custom PHP head above in WP pages
- Log in / Log Out Custom Button
- Should `wp_login` be used since it’s deprecated?
- How to redirect users based on role and content of redirect_to?
- Change CSS based on is_user_logged_in
- How to display login form anywhere, when user isn’t logged in, without redirecting?
- How can I open up my administrative panel to everyone?
- My php code is not being executed
- How can I add a new row in a separate database when someone registers via WordPress?
- One account with multiple logins
- Lost in trying to create user database system
- Shortcode to log user into current URL
- PHP getting error when trying to access WP-Admin Dashboard
- I installed WordPress locally now how do I login?
- If user is logged in not working
- How to make a cookie be on the whole site instead of being on a specific page/
- Change homepage content if user is logged in – BuddyPress
- Set cookie for visitor
- Authentication from sub-folder non-wp cookie WordPress
- setcookies and header send
- is_user_logged_in returning nothing on custom page
- Help with accessing wp-admin page and resolving error messages
- Triggering a timewall after X days
- Set cookie parameters on wp site – PHP not working?
- Removing “There is no account with that username or email address.” error message in “/wp-login.php?action=lostpassword”
- Can’t log in to WordPress wp-admin after adding code to functions.php
- Check if user had autologin & if so, logout
- Fatal error login WordPress [duplicate]
- Admin Panel 404 Error after login
- PHP warning – Use of undefined constant ‘FORCE_SSL_LOGIN’ ‘FORCE_SSL_ADMIN’ on wp-config.php
- How to block specific user id in custom login form?
- Log out without confirmation request (nonce)
- Having trouble creating two shortcodes, one for logged in user and one for visitors
- Call WP Rest-Api to GET /users/me returned NOTHING in console
- Restrict wordpress access to logged users only
- Infinite loop when logging out using custom login form
- Display specific page if user signed in
- Refresh page after login with litespeed cache
- Redirect after login depending on the URL
- Need help with AJAX login to call php in functions.php to handle redirects based on user cap (role)
- How do I send a POST request with params with WordPress REST API
- wp-login.php?redirect_to=https problem
- is_user_logged_in() not working in homepage
- Check if a user is logged into my WordPress site which is on a different server
- Allow user to select location and then set cookie for location in WordPress
- Newbie question. Login/Registration. New PHP page
- List users in a dropdown for login
- Use WP_Query Data In Cookie
- Not logged in when using http
- add bootstrap modal after login in wordpress
- How to set a cookie based on a page Get variable?
- White screen after login attempt
- Create and update Custom Cookie based on multiple GET and POST Values for first time visitors?
- Redirect users not logged in to the standard login page (and back) from some posts and pages
- How to replace wp-admin login page to another location?
- Why can’t I enter the wordpress admin interface?
- Losing Session ID and sessionStorage when navigating to other domains on Multisite
- Keep users logged in Without Remember Me
- Prevent users from display default wordpress login form
- login redirect based on user role not work as expected
- How to change wp-admin and wp-login urls
- How do I do so that people can register on my wordpress site?
- wp_login_url always redirects me to wp-admin
- change div text and link for logged in users