Title: auth_cookie
Published: April 25, 2014
Last modified: February 24, 2026

---

# apply_filters( ‘auth_cookie’, string $cookie, int $user_id, int $expiration, string $scheme, string $token )

## In this article

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

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

Filters the authentication cookie.

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

 `$cookie`string

Authentication cookie.

`$user_id`int

User ID.

`$expiration`int

The time the cookie expires as a UNIX timestamp.

`$scheme`string

Cookie scheme used. Accepts `'auth'`, `'secure_auth'`, or `'logged_in'`.

`$token`string

User’s session token used.

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

    ```php
    return apply_filters( 'auth_cookie', $cookie, $user_id, $expiration, $scheme, $token );
    ```

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

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

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

Generates authentication cookie contents.

  |

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

| Version | Description | 
| [4.0.0](https://developer.wordpress.org/reference/since/4.0.0/) | The `$token` parameter was added. | 
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |

## User Contributed Notes

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