I'm attempting to set a cookie just before a header redirect but it is not working. I have read that setting the cookie after the header redirect line should solve the problem, but I am having no luck. Similarly, a post here previously suggested that if you were using a 'human URL' in the location redirect, you should use '/' in the path parameter of the cookie. This has also been done with no luck.

```
header("Location: $url" . $params);
setcookie('cartstlang', 'lang', 0, '/', '', FALSE, FALSE);
setcookie('cartstdb', 'db', 0, '/', '', FALSE, FALSE);

```

Also note, I have tested this by commenting out the header redirect and then clicking on an link to change pages. The cookies then appeared fine on a var\_dump().

I am developing on XAMPP with PHP 5.3+. I have tested in both IE 8 and Firefox 4.

Any help would be great. Thanks.