Setting a cookie in header
-
I am trying to make a php based style switcher. The switcher code works great. Howerer, I can not set the cookie.
I have placed the following in my header.php file.
`<?php
setcookie (‘sitestyle’, $set, time()+31536000, ‘/’, ‘localhost’, ‘0’);
?>’It will not set the cookie and I have no idea why. It is above the doc type decleration as required but it does not seem to want to work. Any tips would be great.
Thanks.
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘Setting a cookie in header’ is closed to new replies.