0% found this document useful (0 votes)
40 views1 page

Cookies

The document discusses cookies and sessions in PHP. It explains how to use the setcookie() function to create cookies by passing in a name, value, expiration time, path, domain, and secure flag. It provides an example of setting a cookie. It also shows how to delete a cookie if it is set. Additionally, it outlines the basic steps to use sessions in PHP - starting the session, registering session variables, and destroying the session.

Uploaded by

api-20013511
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views1 page

Cookies

The document discusses cookies and sessions in PHP. It explains how to use the setcookie() function to create cookies by passing in a name, value, expiration time, path, domain, and secure flag. It provides an example of setting a cookie. It also shows how to delete a cookie if it is set. Additionally, it outlines the basic steps to use sessions in PHP - starting the session, registering session variables, and destroying the session.

Uploaded by

api-20013511
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

Cookies

Setcookie() function
Int setcookie(string name, string value, int expire, string path, string domain,
int secure);
Notes: it same with header()

Setcookie(“TestCookie”,$value,time()+3600,”/~jollen/”,”.o3.net”,1);
Setcookie(“username”, “Jollen”, time()+3600);

If(isset($UserName))
Setcookie(“UserName”); //delete cookie

Session
Step 1
Session_start();
Step 2
Session_register(“userID”);
Step 3
Session_destroy();

You might also like