0

I created a custom plugin for login and registration forms. When I log in for a new user, 4 cookies are set : PHPSESSID, wordpress_test_cookie, wordpress_logged_in_, and 2 wordpress_sec_ .

But I don't have wp-settings- and wp-settings-time-. However my admin account has these cookies.

I can't find a wordpress documentation that explain which function set these cookies. It is just said :

Without plugins installed, WordPress sets the following cookies:

  • wordpress_[hash]
  • wordpress_logged_in_[hash]
  • wordpress_test_cookie
  • wp-settings-{time}-[UID]

I don't use "setcookie" at the moment .

The functions I use to allow him to access his account :

wp_clear_auth_cookie();
wp_set_current_user($info->ID, $username);  
wp_set_auth_cookie( $info->ID, true, is_ssl() );
3
  • 1
    Searching for wp-settings-time- I found the following occurences: wp-includes/js/utils.min.js line 2, wp-includes/js/utils.js line 188, wp-includes/pluggable.php line 1029, wp-includes/option.php lines 1039 & 1052. Have you checked these files to see when the code is triggered?
    – kero
    Apr 13, 2021 at 12:33
  • 1
    Is there a problem you are trying to solve that has lead you to this that you believe is caused by the lack of these 2 cookies?
    – Tom J Nowell
    Apr 13, 2021 at 12:57
  • Thanks for your answers. I found the function corresponding wp_user_settings().
    – imagIne
    Apr 14, 2021 at 9:28

0

Your Answer

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

Browse other questions tagged or ask your own question.