Home >> PHP >> What Is a Persistent Cookie in PHP

What Is a Persistent Cookie in PHP

A persistent cookie is a cookie which is stored in a cookie file permanently on the client computer.

Syntax

setcookie(name, value, expire, path, domain);

Set Cookie

setcookie('user','raj',time()+365*60*60*24);

Access Cookie

echo $_COOKIE['user'];

Remove Cookie

setcookie('user','raj',time()-365*60*60*24);

Comments (1)
  • Rohit Sharma 08/Sep/2022

    Exact and clear answer of persistent cookie

Post Your Comment

Next Questions
What does a special set of tags do
What are tags type
How do you define a constant
How To Write the FORM Tag for Uploading Files
What is the difference between include, include_once
What is the difference between require and require_once
What is difference between include_once and require_once
What is difference between include and require
What is meant by urlencode and urldecode
How To Get the Uploaded File Information
Would I use print "$a dollars" or "{$a} dollars" to print out the amount of dollars
How do you pass a variable by value
How do I find out the number of parameters passed into function
How To Protect Special Characters in Query String
What is the difference between GET and POST
What are the different types of errors
If conditional statement
If else conditional statement
If else / else if conditional statement
Switch conditional statement
For loop
While loop
Do while loop
Foreach loop
Operators

Copyright ©2022 coderraj.com. All Rights Reserved.