wordpress cookies wild card

wordpress names cookies like

wordpress_logged_in_bbfa5b726c6b7a9cf3cda9370be3ee91

Read More

the part after _in is different for every user. Is there a way I can use it with wild card in

$_COOKIE["wordpress_logged_in_bbfa5b726c6b7a9cf3cda9370be3ee91"]

so something like

$_COOKIE["wordpress_logged_in_%"]

Related posts

Leave a Reply

1 comment

  1. You will have to loop through the entire $_COOKIE array to see if it matches the pattern:

    $matches = array();
    foreach($_COOKIE as $key => $value) {
      if(substr($key, 0, 20) == 'wordpress_logged_in_') {
        $matches[] = $key;
      }
    }
    //$matches now contains the key of all matching cookies