How to detect a user that is not logged in

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?

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.

Leave a Comment