4

I have been searching on how to overwrite a certain cookies value like for example in user's information. how can I call the cookie back to the client matched on the user's input. for the cookie to change its value?

hakre
  • 193,403
  • 52
  • 435
  • 836
Webdev
  • 41
  • 1
  • 1
  • 2
  • Check here: http://ar.php.net/manual/es/function.setcookie.php It is very important to understand that you sending a HEADER and needs to be done before any output. – dvicino Feb 03 '12 at 03:30

1 Answers1

8

You can only overwrite cookies that you have access to modify. If you are setting a cookie yourself with setcookie() the same functionality will overwrite that cookie.

Cookies must be modified before any data is sent to the browser. The browser identifies a cookie and stores it based on headers sent from the server to the browser. The HTTP protocol will not accept header elements during transmission of the body.

Steve Buzonas
  • 5,300
  • 1
  • 33
  • 55