Home > PHP > Function > HTTP > http_parse_cookie()

http_parse_cookie()

http_parse_cookie - Parse HTTP cookie

Syntax

object http_parse_cookie (string $cookie, int $flags, array $allowed_extras)

Arguments

  • cookie - string containing the value of a Set-Cookieresponse header
  • flags - parse flags ( HTTP_COOKIE_PARSE_RAW)
  • allowed_extras - array containing recognized extrakeys; by default all unknown keys will be treated as cookie names

Description

Parses HTTP cookies like sent in a response into a struct.

Version

PHP PECL pecl_http >= 0.20.0

Return value

Returns a stdClass object on success or FALSE on failure.