Reputation:
I'm trying to delete my cookie when user click on logout link. But i cant do it via set_cookie and set -time. There appears header modify error - its already sent. Is there any other way to delete cookie?
Upvotes: 0
Views: 45
Reputation: 71422
You have to delete any cookies before cookies are sent to the browser along in headers. You are getting this error because you are likely trying to unset a cookie after some sort of output has been sent to the browser. This is not allowed and will not work.
Upvotes: 0