0

I am trying to modify a theme template to set some new cookies with php. My code works on a non-SMF test page but it stops the page from loading when I put it into the index.template.php file.

The cookies are set in php and the whole code basically attempts to get the POST data from a new form on the page.

As I mentioned, on a simple test page I can put my php code above the HTML and it works fine.

Is there something special about the way SMF handles cookies?

Thanks in advance

Sara44
  • 382
  • 1
  • 8
  • 24

1 Answers1

1

OK, they've probably already send out headers.

You can't set a cookie once headers have been sent.

==== Update ====

If you want to use jQuery see this:

How do I set/unset cookie with jQuery?

Community
  • 1
  • 1
Snowcrash
  • 66,400
  • 60
  • 203
  • 323
  • Thanks. Can I set cookies with jQuery if php has already sent headers and set some other cookies? – Sara44 Nov 05 '12 at 19:14