Retrieves one or more cookies.

This function is valid in v2.13.2 to v2.24.3. This function has been downloaded 62 times.


{string|RegExp|undefined|null=} name Optional, Default:undefined
Either the name of the cookie to get or a regular expression matching the names of all of the cookies to get. If undefined or null is supplied that means all cookies should be retrieved.
{*=} opt_defaultValue Optional, Default:undefined
The default value to return in the case that name was a string but the corresponding cookie doesn't exist.


If name is a string and matches the name of a cookie, that cookie's value will be returned as a string. If name is a string but doesn't match the name of a cookie opt_defaultValue will be returned. If name is of type RegExp an object containing all of the cookies with names that match the specified regular expression will be returned. If name is undefined or null an object containing all of the cookies will be returned. If an object is returned each key will represent the name of each cookie and each value will be the value of that cookie.

Required Function

This function directly requires the following function which is included automatically:

  • typeOf()
    Either gets the type of a value or adds a constructor registering its custom type name.

Requiring Function

This function is directly required by the following function: