Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

http_parse_cookie(3) [php man page]

HTTP_PARSE_COOKIE(3)							 1						      HTTP_PARSE_COOKIE(3)

http_parse_cookie - Parse HTTP cookie

SYNOPSIS
object http_parse_cookie (string $cookie, [int $flags], [array $allowed_extras]) DESCRIPTION
Parses HTTP cookies like sent in a response into a struct. PARAMETERS
o $cookie - string containing the value of a Set-Cookie response header o $flags - parse flags ( HTTP_COOKIE_PARSE_RAW) o $allowed_extras - array containing recognized extra keys; by default all unknown keys will be treated as cookie names RETURN VALUES
Returns a stdClass object on success or FALSE on failure. EXAMPLES
Example #1 Using http_parse_cookie(3) <?php print_r(http_parse_cookie("foo=bar; bar=baz; path=/; domain=example.com; comment=; secure", 0, array("comment"))); ?> The above example will output: stdClass Object ( [cookies] => Array ( [foo] => bar [bar] => baz ) [extras] => Array ( [comment] => ) [flags] => 16 [expires] => 0 [path] => / [domain] => example.com ) SEE ALSO
http_parse_headers(3), http_parse_message(3), http_build_cookie(3). PHP Documentation Group HTTP_PARSE_COOKIE(3)

Check Out this Related Man Page

Mojo::Cookie::Response(3pm)				User Contributed Perl Documentation			       Mojo::Cookie::Response(3pm)

NAME
Mojo::Cookie::Response - HTTP 1.1 response cookie container SYNOPSIS
use Mojo::Cookie::Response; my $cookie = Mojo::Cookie::Response->new; $cookie->name('foo'); $cookie->value('bar'); say $cookie; DESCRIPTION
Mojo::Cookie::Response is a container for HTTP 1.1 response cookies. ATTRIBUTES
Mojo::Cookie::Response inherits all attributes from Mojo::Cookie and implements the followign new ones. "domain" my $domain = $cookie->domain; $cookie = $cookie->domain('localhost'); Cookie domain. "httponly" my $httponly = $cookie->httponly; $cookie = $cookie->httponly(1); HttpOnly flag, which can prevent client side scripts from accessing this cookie. "max_age" my $max_age = $cookie->max_age; $cookie = $cookie->max_age(60); Max age for cookie in seconds. "path" my $path = $cookie->path; $cookie = $cookie->path('/test'); Cookie path. "secure" my $secure = $cookie->secure; $cookie = $cookie->secure(1); Secure flag, which instructs browsers to only send this cookie over HTTPS connections. METHODS
Mojo::Cookie::Response inherits all methods from Mojo::Cookie and implements the following new ones. "expires" my $expires = $cookie->expires; $cookie = $cookie->expires(time + 60); $cookie = $cookie->expires(Mojo::Date->new(time + 60)); Expiration for cookie in seconds. "parse" my $cookies = $cookie->parse('f=b; path=/'); Parse cookies. "to_string" my $string = $cookie->to_string; Render cookie. SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>. perl v5.14.2 2012-09-05 Mojo::Cookie::Response(3pm)
Man Page