0

I've noticed that when I setup in a script two cookies with the same name/domain but one using php setcookie, with httponly flag enabled, and the other using javascript code when I try to retrive the cookie value with the use of the $_COOKIE var I get only the javascript one.

Is there a way to retrive with php the httponly cookie?

P.S. Used PHP 5.4 and Iceweasel 31.4.0

1 Answers1

0

It is not possible. If a script on the page sets a value for the same cookie, the server sent cookie is overwritten.

Sami Kuhmonen
  • 30,146
  • 9
  • 61
  • 74
  • As I supposed...It's interesting that, if the two cookies have different path (they are different samehow :) $_SERVER['HTTP_COOKIE'] contains both – exeguibile italia Sep 22 '15 at 10:47