Title: secure_auth_cookie
Published: April 25, 2014
Last modified: May 20, 2026

---

# apply_filters( ‘secure_auth_cookie’, bool $secure, int $user_id )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/hooks/secure_auth_cookie/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/secure_auth_cookie/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/secure_auth_cookie/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/secure_auth_cookie/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/hooks/secure_auth_cookie/?output_format=md#wp--skip-link--target)

Filters whether the auth cookie should only be sent over HTTPS.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/secure_auth_cookie/?output_format=md#parameters)󠁿

 `$secure`bool

Whether the cookie should only be sent over HTTPS.

`$user_id`int

User ID.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/secure_auth_cookie/?output_format=md#source)󠁿

    ```php
    $secure = apply_filters( 'secure_auth_cookie', $secure, $user_id );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/pluggable.php#L1110)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/pluggable.php#L1110-L1110)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/secure_auth_cookie/?output_format=md#related)󠁿

| Used by | Description | 
| [wp_set_auth_cookie()](https://developer.wordpress.org/reference/functions/wp_set_auth_cookie/)`wp-includes/pluggable.php` |

Sets the authentication cookies for a given user ID.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/secure_auth_cookie/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fsecure_auth_cookie%2F)
before being able to contribute a note or feedback.