\Zend_Http_Cookie
Zend_Http_Cookie is a class describing an HTTP cookie and all it's parameters.
Zend_Http_Cookie is a class describing an HTTP cookie and all it's parameters. The
class also enables validating whether the cookie should be sent to the server in
a specified scenario according to the request URI, the expiry time and whether
session cookies should be used or not. Generally speaking cookies should be
contained in a Cookiejar object, or instantiated manually and added to an HTTP
request.
See http://wp.netscape.com/newsref/std/cookie_spec.html for some specs.
- Copyright: Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com/)
- License: http://framework.zend.com/license/new-bsd New BSD License
Synopsis
class Zend_Http_Cookie
{
- // members
- protected $name;
- protected $value;
- protected $expires;
- protected $domain;
- protected $path;
- protected $secure;
- // methods
- public void __construct()
- public string getName()
- public string getValue()
- public string getDomain()
- public string getPath()
- public int|null getExpiryTime()
- public boolean isSecure()
- public boolean isExpired()
- public boolean isSessionCookie()
- public boolean match()
- public string __toString()
- public static Zend_Http_Cookie fromString()
Tasks
Line | Task |
---|---|
98+ | Add validation of each one of the parameters (legal domain, etc.) |
Members
protected
- $domain
—
string
Cookie domain - $expires
—
int
Cookie expiry date - $name
—
string
Cookie name - $path
—
string
Cookie path - $secure
—
boolean
Whether the cookie is secure or not - $value
—
string
Cookie value
Methods
public
- __construct() — Cookie object constructor
- __toString() — Get the cookie as a string, suitable for sending as a "Cookie" header in an HTTP request
- fromString() — Generate a new Cookie object from a cookie string (for example the value of the Set-Cookie HTTP header)
- getDomain() — Get cookie domain
- getExpiryTime() — Get the expiry time of the cookie, or null if no expiry time is set
- getName() — Get Cookie name
- getPath() — Get the cookie path
- getValue() — Get cookie value
- isExpired() — Check whether the cookie has expired
- isSecure() — Check whether the cookie should only be sent over secure connections
- isSessionCookie() — Check whether the cookie is a session cookie (has no expiry time set)
- match() — Checks whether the cookie should be sent or not in a specific scenario