Computer >> Computer tutorials >  >> Programming >> PHP

What is the meaning of a Persistent Cookie in PHP?


A persistent cookie is a cookie that is stored in a cookie file permanently on the browser's computer. As we know cookies are small text files which are as a matter, of course, temporary cookies which stored only in the browser's memory. When the browser is closed, temporary cookies will be erased from the memory.

When to use persistent cookies −

  • Temporary cookies can not be used for tracking long-term information.
  • Persistent cookies can be used for tracking long-term information.
  • Temporary cookies are safer because no programs other than the browser can access them.
  • Persistent cookies are less secure because users can open cookie files to see the cookie values.