How can a cookie be deleted after making a database entry in PHP?
To delete a cookie after making a database entry in PHP, you can simply set the cookie with an expiration time in the past. This will effectively delete the cookie from the user's browser.
// Make database entry
// Set cookie with expiration time in the past to delete it
setcookie('cookie_name', '', time() - 3600, '/');
Keywords
Related Questions
- Is it feasible to emulate PHP functions using client-side Java or JavaScript?
- What are some alternative approaches to handling user authentication and data sharing within frames using PHP?
- What are the potential risks of allowing users to input file names for downloads in PHP scripts, and how can these risks be mitigated?