top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

How the cookie can be set and destroyed in PHP?

+1 vote
47 views
How the cookie can be set and destroyed in PHP?
posted May 21, 2014 by Karamjeet Singh

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

1 Answer

0 votes

By Using
setcookie(name,value,expire,path,domain);
function ,you can set the cookies in PHP.
e.g. setcookie("user","xyz",time()+3600) ;
The above written function will set the cookie.

For Destroying the cookie, you should set the cookie in past.
e.g. setcookie("user","xyz",time()-3600);

answer May 22, 2014 by Mohit Sharma
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...