Zend\Http\Header\SetCookie
Synopsis
class SetCookie
implements
MultipleHeaderInterface
{
- // members
- protected string|null $name;
- protected string|null $value;
- protected int|null $version;
- protected int|null $maxAge;
- protected int|null $expires;
- protected string|null $domain;
- protected string|null $path;
- protected bool|null $secure;
- protected bool $quoteFieldValue;
- protected bool|null $httponly;
- // methods
- public static array|SetCookie fromString()
- public SetCookie __construct()
- public string getFieldName()
- public string getFieldValue()
- public SetCookie setName()
- public string getName()
- public SetCookie setValue()
- public string getValue()
- public SetCookie setVersion()
- public int getVersion()
- public SetCookie setMaxAge()
- public int getMaxAge()
- public SetCookie setExpires()
- public int|string getExpires()
- public SetCookie setDomain()
- public string getDomain()
- public SetCookie setPath()
- public string getPath()
- public SetCookie setSecure()
- public SetCookie setQuoteFieldValue()
- public bool isSecure()
- public SetCookie setHttponly()
- public bool isHttponly()
- public bool isExpired()
- public bool isSessionCookie()
- public bool hasQuoteFieldValue()
- public void isValidForRequest()
- public bool match()
- public static bool matchCookieDomain()
- public static bool matchCookiePath()
- public void toString()
- public void toStringMultipleHeaders()
Hierarchy
Implements
Tasks
Line | Task |
---|---|
180+ | Add validation of each one of the parameters (legal domain, etc.) |
Members
protected
- $domain
—
Zend\Http\Header\string|null
Cookie domain - $expires
—
Zend\Http\Header\int|null
Cookie expiry date - $httponly — Zend\Http\Header\bool|null
- $maxAge
—
Zend\Http\Header\int|null
Max Age - $name
—
Zend\Http\Header\string|null
Cookie name - $path
—
Zend\Http\Header\string|null
Cookie path - $quoteFieldValue
—
Zend\Http\Header\bool
If the value need to be quoted or not - $secure
—
Zend\Http\Header\bool|null
Whether the cookie is secure or not - $value
—
Zend\Http\Header\string|null
Cookie value - $version
—
Zend\Http\Header\int|null
Version
Methods
public
- __construct() — Cookie object constructor
- fromString()
- getDomain()
- getExpires()
- getFieldName()
- getFieldValue()
- getMaxAge() — Get Max-Age
- getName()
- getPath()
- getValue()
- getVersion() — Get version
- hasQuoteFieldValue() — Check whether the value for this cookie should be quoted
- isExpired() — Check whether the cookie has expired
- isHttponly()
- isSecure()
- isSessionCookie() — Check whether the cookie is a session cookie (has no expiry time set)
- isValidForRequest()
- match() — Checks whether the cookie should be sent or not in a specific scenario
- matchCookieDomain() — Check if a cookie's domain matches a host name.
- matchCookiePath() — Check if a cookie's path matches a URL path
- setDomain()
- setExpires()
- setHttponly()
- setMaxAge() — Set Max-Age
- setName()
- setPath()
- setQuoteFieldValue() — Set whether the value for this cookie should be quoted
- setSecure()
- setValue()
- setVersion() — Set version
- toString()
- toStringMultipleHeaders()