using wp's is_ssl() function for setcookie()'s secure parameter

isekai
daggerhart 9 years ago
parent 4db956c119
commit 6715eb2baf

@ -133,7 +133,7 @@ class OpenID_Connect_Generic_Client_Wrapper {
* Remove cookies * Remove cookies
*/ */
function wp_logout() { function wp_logout() {
setcookie( $this->cookie_id_key, false, 0, COOKIEPATH, COOKIE_DOMAIN, TRUE ); setcookie( $this->cookie_id_key, false, 0, COOKIEPATH, COOKIE_DOMAIN, is_ssl() );
} }
/** /**
@ -290,7 +290,7 @@ class OpenID_Connect_Generic_Client_Wrapper {
// save our authorization cookie for the response expiration // save our authorization cookie for the response expiration
$oauth_expiry = $token_response['expires_in'] + current_time( 'timestamp', TRUE ); $oauth_expiry = $token_response['expires_in'] + current_time( 'timestamp', TRUE );
setcookie( $this->cookie_id_key, $subject_identity, $oauth_expiry, COOKIEPATH, COOKIE_DOMAIN, TRUE ); setcookie( $this->cookie_id_key, $subject_identity, $oauth_expiry, COOKIEPATH, COOKIE_DOMAIN, is_ssl() );
// you did great, have a cookie! // you did great, have a cookie!
wp_set_auth_cookie( $user->ID, FALSE ); wp_set_auth_cookie( $user->ID, FALSE );

Loading…
Cancel
Save