Is there an easy way to see if a user - someone how has logged in in the past but is not currently logged in - is visiting my site?

I was thinking that checking if $COOKIE[TEST_COOKIE] is set, but I am uncertain.

  1. Is this a good method?
  2. Is there a better cookie to check for?
  3. What would you do?
  • Hmmm ... TEST_COOKIE seems to disappear when session is over. Probably not a good idea. What do you think about checking to see if $COOKIE is not empty might be a better method as the wp-settings-time-* cookie seems to stick around for a year.
    – mfields
    Commented Jul 5, 2011 at 13:11
  • Are you using $COOKIE or $_COOKIE?
    – EAMann
    Commented Jul 5, 2011 at 15:30
  • Was doing it right in the code ... not sure where the underscore went? I've abandoned this though.
    – mfields
    Commented Jul 5, 2011 at 16:41

1 Answer 1


You could check for this cookie wp-settings-1 it lasts for 1 day and then also check if wordpress_test_cookie is available. Or you could just write a simple plugin that checks if the user is logged in and adds a longer term cookie to check against.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.