Title: setcookie() not working
Last modified: August 19, 2016

---

# setcookie() not working

 *  [PeteMcFarlane](https://wordpress.org/support/users/petemcfarlane/)
 * (@petemcfarlane)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/setcookie-not-working/)
 * Hello,
    I have spent hours trying to figure this out and cannot find any answers
   in the forums either…
 * I have created different style sheets which I select using simple PHP GET links.
   These work fine. I wanted to create a cookie so that when the user changes page
   their browser automatically updates to what their cookie is set to.
 * Here is the site: [http://66.147.244.209/~peoplei1/website2/](http://66.147.244.209/~peoplei1/website2/)
 * Things I have already tried:
 * removing any spaces in my wp-config.php file,
 * changing the permissions of the file to 644,
 * setting the expiry, not setting the expiry,
 * setting the path to COOKIEPATH, setting the path to “/”, not setting a path
 * setting the domain to COOKIE_DOMAIN, setting the domain to 66.147.244.209, not
   
   setting a domain.
 * I understand that any setcookie() has to appear before any page data, as in <
   html …>
 * I have tried calling the cookie from functions.php,
 * and I am rather frustrated!!
 * Any advice would be much appreciated,
    Thanks in advance!

The topic ‘setcookie() not working’ is closed to new replies.

## Tags

 * [cookie](https://wordpress.org/support/topic-tag/cookie/)
 * [set](https://wordpress.org/support/topic-tag/set/)
 * [setcookie](https://wordpress.org/support/topic-tag/setcookie/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [PeteMcFarlane](https://wordpress.org/support/users/petemcfarlane/)
 * Last activity: [15 years, 4 months ago](https://wordpress.org/support/topic/setcookie-not-working/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
