goog.net.Cookies |
context
: Document
The context document to get/set cookies on.
|
![]()
Removes all cookies for this document. Note that this will only remove
cookies from the current path and domain. If there are cookies set using a
subpath and/or another domain these will still be there.
|
code » | |||||||
Returns whether there is a cookie with the given name.
|
code » | |||||||
Returns whether there is a cookie with the given value. (This is an O(n)
operation.)
|
code » | |||||||
Returns the value for the first cookie with the given name.
|
code » | |||||||
Private helper function to allow testing cookies without depending on the
browser. IE6 can return null here.
Returns: string
Returns the
document.cookie .
|
code » | |||||||
No description.
Returns: number
The number of cookies for this document.
|
code » | |||||||
Gets the names and values for all the cookies.
Returns: !Object
An object with keys and values.
|
code » | |||||||
Gets the names for all the cookies.
|
code » | |||||||
No description.
|
code » | |||||||
Gets the values for all the cookies.
|
code » | |||||||
No description.
Returns: boolean
Whether there are any cookies for this document.
|
code » | |||||||
Returns true if cookies are enabled.
Returns: boolean
True if cookies are enabled.
|
code » | |||||||
We do not allow '=', ';', or white space in the name.
NOTE: The following are allowed by this method, but should be avoided for
cookies handled by the server.
- any name starting with '$'
- 'Comment'
- 'Domain'
- 'Expires'
- 'Max-Age'
- 'Path'
- 'Secure'
- 'Version'
|
code » | |||||||
We do not allow ';' or line break in the value.
Spec does not mention any illegal characters, but in practice semi-colons
break parsing and line breaks truncate the name.
|
code » | |||||||
Removes and expires a cookie.
Arguments:
Returns: boolean
Whether the cookie existed before it was removed.
|
code » | |||||||
![]()
Sets a cookie. The max_age can be -1 to set a session cookie. To remove and
expire cookies, use remove() instead.
Neither the
name nor the value are encoded in any way. It is
up to the callers of get and set (as well as all the other
methods) to handle any possible encoding and decoding.
Arguments:
|
code » | |||||||
![]()
Private helper function to allow testing cookies without depending on the
browser.
Arguments:
|
code » |
![]()
The context document to get/set cookies on
|
Code » |
![]()
Static constant for the size of cookies. Per the spec, there's a 4K limit
to the size of a cookie. To make sure users can't break this limit, we
should truncate long cookies at 3950 bytes, to be extra careful with dumb
browsers/proxies that interpret 4K as 4000 rather than 4096.
|
Code » | |
![]()
RegExp used to split the cookies string.
|
Code » |