What is the different between cookies and session in php?
Answer Posted / vivek srivastava
Sessions: are basically tokens which are generated when a
user proceeds with a login mechanism. Each time when a user
logged into a website a new and unique token is generated
and it will destroyed whenever he/she logged out from that
site or power goes off. However, session information is
temporary and will be deleted after the user has left the
website.
Cookies:are temporary files which are store in users hard
disk. A cookie is often used to identify a user. Suppose a
user enters into a website and without logging off he/she
closed the page, next time when he/she open the page he/she
found himself/ herself logged in. This is because of
cookies, they store the user information. We can set the
cookies by <b>setCookie()</b> function. The syntax if
setCookie function is <b>setCookie(name, value, expire,
path, domain);</b>.
| Is This Answer Correct ? | 30 Yes | 2 No |
Post New Answer View All Answers
Is php dead 2019?
How send email in php?
What are the advantages and disadvantages of cascade style sheets?
Can you specify the "new line" character in single-quoted strings?
Is multilevel inheritance possible in php?
What is print_r?
Can I include php in javascript?
How to increase the maximum execution time of a script in php?
How I can control asset documents without GR/IR?
What is a controller in php?
Is php easier than javascript?
What are the benefits of composer?
How to get complete current page url in php?
What is the purpose of the '.frm' file extension? What do thes file contain?
Write an example to remove html tags from a string in php?