Title: Cookie &#8211; same site attribute
Last modified: August 22, 2024

---

# Cookie – same site attribute

 *  [wpbackend](https://wordpress.org/support/users/wpbackend/)
 * (@wpbackend)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/cookie-same-site-attribute/)
 * Hi,
 * Can you please advise that a WordPress site need cookie with same site attribute?
   Because we are using plugins and no custom codes for any kind of cookies (for
   storing info).
 * As a part of security, we have to check this.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/cookie-same-site-attribute/#post-17968285)
 * Take a look here: [https://wordpress.org/support/topic/same-site-cookie-issue-what-do-i-do/](https://wordpress.org/support/topic/same-site-cookie-issue-what-do-i-do/)
 *  Thread Starter [wpbackend](https://wordpress.org/support/users/wpbackend/)
 * (@wpbackend)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/cookie-same-site-attribute/#post-17968303)
 * Ok. Is there any issuewith adding this?
 * setcookie(“cookiename”, “cookievalue”, [“samesite” => “Strict”]);
 * Also we don’t have any console issues related to cookie same-site attribute
    -  This reply was modified 1 year, 9 months ago by [wpbackend](https://wordpress.org/support/users/wpbackend/).
 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/cookie-same-site-attribute/#post-17968592)
 * In my test, it works without any problems. However, such an entry in `wp-config.
   php` does not make sense purely in terms of the method and some plugins may not
   be compatible with it. A better solution in terms of WordPress would probably
   be an addition via init hook, as described here: [https://iamsteve.me/blog/setting-a-cookie-with-wordpress](https://iamsteve.me/blog/setting-a-cookie-with-wordpress)–
   however, this would have to be added in the `functions.php` of a child theme,
   in an individual plugin or via a code snippet plugin.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Cookie – same site attribute’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [threadi](https://wordpress.org/support/users/threadi/)
 * Last activity: [1 year, 9 months ago](https://wordpress.org/support/topic/cookie-same-site-attribute/#post-17968592)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
