Skip to content
Advertisement

How to delete cookie on codeigniter

I don’t know how to delete a cookie. I want is when I submit a form. The cookie is also delete. I try the delete_cookie(“name”) but is not working. I think because the cookie I created by javascript. Please check my code to fix this problem.

This is my sample text field:

JavaScript

and this is the javascript

JavaScript

Advertisement

Answer

Using Codeigniter, put it inside the save method of your controller:

Try:

JavaScript

Details on official documentation

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement