Welcome to the OzoneAsylum FaqWiki
Frequently Asked Questions
Server Side Coding
PHP

How do I set and read cookies in PHP? Pages that link to <a href="https://ozoneasylum.com/backlink?for=5537" title="Pages that link to How do I set and read cookies in PHP?" rel="nofollow" >How do I set and read cookies in PHP?\

This is much simpler to do than the JavaScript method. Use the setcookie() function. The cookie can, after the next page load, be read via the $_COOKIES variable.

Setting cookies can be tricky, be sure to specify at least a path of the optional parameters, or your cookies will not work in some older browsers.

------------------------------
Relevant links:

setcookie()

------------------------------
Relevant FAQs:

How do I set and read cookies in JavaScript?



(Edited by: Tyberius Prime on Tue 04-Feb-2003)

« BackwardsOnwards »

Show Forum Drop Down Menu