Removing wordpress cookie from non-wordpress site
I am using wordpress for a blog on my site. So I installed wordpress in a subdirectory (eg: www.example.com/blog).
I handle all of the sign in/sign out through my main site.
For signing in I set a cookie which is read upon entering the wordpress site.
However, when it comes time to sign out, I want to also remove the cookie that WordPress sets (it starts with "wordpress_logged_in"), so that the user will also be signed out of the wordpress blog.
For some reason, when I get all the cookies sent with the request (javax.servlet.http.HttpServletRequest
), the "wordpress_logged_in" cookie (as well as all other cookies set by wordpress) are not recognized.
Other cookies set by plugins on wordpress are recognized, just the cookies set by wordpress directly aren't recognized.
How can I also remove the wordpress cookie (I wanted to loop through all cookies and remove the one starting with "wordpress_logged_in...").
(I'm running in a local environment on 2 different ports, but I don't think that's the issue since the request
is returning other cookies set by plugins).
Or, is there a better way to do what I'm trying to do?
Thanks.