Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

$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!

share|improve this question
    
In addition to the question above: Cookie is secure now, but the user is logged out automatically directly after loggin in. How can I prevent this? Thanks again! –  user19512 Aug 21 '12 at 14:55
add comment

1 Answer

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' );
share|improve this answer
    
Great, thx for your fast reply - I understand and will try this! –  Markus Aug 21 '12 at 14:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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