phpcookiessmf-forum

Setting cookies other than standard


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


Solution

  • 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?