PHP: http_parse_cookie - Manual

downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

http_parse_headers ob_inflatehandler

Last updated: Sat, 27 Jan 2007

view this page in

# http_parse_cookie

(no version information, might be only in CVS)

http_parse_cookie -- Parse HTTP cookie

## Описание

object http_parse_cookie ( [string cookie [, int flags [, array allowed_extras]]] )

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

## Список параметров

`cookie`

  String containing the value of a `Set-Cookie` response header

`flags`

  Parse flags

`allowed_extras`

  Array containing recognized extra keys. By default all unknown keys will be treated as cookie names.

## Возвращаемые значения

Returns an stdClass like shown in the example on success or FALSE on failure.

## Примеры

Пример 1. Using http_parse_cookie()

`<?php print_r(http_parse_cookie("foo=bar; bar=baz; path=/; domain=example.com; comment=; secure", 0, array("comment"))); ?>`

Результат выполнения данного примера:

    stdClass Object
    (
      [cookies] => Array
      (
        [foo] => bar
        [bar] => baz
      )

      [extras] => Array
      (
        [comment] =>
      )

      [flags] => 16
      [expires] => 0
      [path] => /
      [domain] => example.com
    )

add a note User Contributed Notes
http_parse_cookie
There are no user contributed notes for this page.
http_parse_headers ob_inflatehandler

Last updated: Sat, 27 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 09:32:46 2007 PST