Information Technology Questions and Answers Community

Creating persistent cookie

How can we create a persistent cookie in PHP? 

PHP        
Your Answer: 

1 Answers

We can create it through this code-

setcookie(‘cookieName’, ‘cookieValue’, strtotime(‘+2 years’) );

So, the persistent cookie has been set for 2 years.

Answered On 28 Mar at 09:32
Edit Account
LOGIN INFORMATION
Change Settings
Email Notifications Notifications will be sent to abcd@gmail.com
Select option for your email notifications:
Mature / News Filter We'll send on email when new jobs are posted
Option 2 for email notification We'll send on email when new jobs are posted