Jnr PHP/Codeigniter Developer Question:

Tell us how do you create a persistent cookie in php?

Tweet Share WhatsApp

Answer:

Cookies will only persist for the time you define. To do it for 1 year you can simply do:

setcookie( "cookieName", 'cookieValue', strtotime( '+1 year' ) ); //set for 1 year

Download Jnr PHP/Codeigniter Developer PDF Read All 61 Jnr PHP/Codeigniter Developer Questions
Previous QuestionNext Question
Explain me what do you call the constructor of a parent class?Tell me are objects in PHP 5+ passed by value or reference?