How can we set and destroy the cookie in php?
Answer / Hitendra Kumar Trivedi
To set a cookie in PHP:nn```phpnsetcookie("cookie_name", "cookie_value", time() + (86400 * 30), "/" );n```nNote that the fourth parameter sets the path for which the cookie is valid. To destroy a cookie, set its expiration to an earlier date:nn```phpnssetcookie("cookie_name", "", time() - (86400 * 30));n```
| Is This Answer Correct ? | 0 Yes | 0 No |
what is the current salary package in India for a PHP & MySQL programmer who has 3 years experience
127 Answers ABC, BLG Logistics, Google, HCL, IBM, Infosys, People Group, PHP, Torque Infotech, V Angelz Technologies, Yahoo,
Explain what is the difference between session and cookie?
How does the identity operator === compare two values?
"mysql_fetch_row — Get a result row as an enumerated array",this sentence comes from the PHP offical manual.However ,i can not understand the words "enumerated array".I need some help.Thanks a lot to everyone that reply.
What is the role of php?
1.Where are the cookies storing ? 2.What is the drawback of using cookies ? 3. If two site is having same cookie name and different values what will be the output if we echo the cookie name from those sites ? How can we solve this issue (How can we specify the domain name)?
what is benefit of magento?
Is it difficult to learn php?
Is php 7.0 stable?
How can you insert javascript in php code?
How can I retrieve values from one database server and store them in other database server using PHP?
2 Answers DRC Systems, Photon,
What is the use of mysql_real_escape_string in php?