Secure wordpress_logged_in cookie

I have to make sure, that the WordPress cookie set after successful log in, “wordpress_logged_in_[salt-sth]” is set to be available for secure connections only.

It looks like that it´s a filter used in pluggable.php, line 653

Read More

$secure_logged_in_cookie = apply_filters(‘secure_logged_in_cookie’, false, $user_id, $secure);

How can I set it to secure, WITHOUT modifiyng the wordpress core files?
If I modify the core (set to true) – it´s not possible to logout anymore…

Thank U!

Related posts

Leave a Reply

1 comment

  1. The advantage of a filter is that you can change a value without modifying core WP files. The filter you list:

    $secure_logged_in_cookie = apply_filters('secure_logged_in_cookie', false, $user_id, $secure);
    

    Passes in three values. You just need to build a function that accepts those three values and returns true (or just returns true by default.

    This function, for example, merely returns true for whatever value is passed in to that filter:

    add_filter( 'secure_logged_in_cookie', '__return_true' );