---
name: "Bio::DB::EUtilities::Cookie"
section: "3pm"
platform: "linux"
package: "bioperl"
version: "1.5.2.102-3"
release: "Debian 5.0 (Lenny)"
platforms: ["linux"]
url: "https://new.carta.tech/Bio::DB::EUtilities::Cookie"
---

# Bio::DB::EUtilities::Cookie(3pm)

simple object to hold NCBI cookie information and descriptions

## NAME

Bio::DB::EUtilities::Cookie - simple object to hold NCBI cookie information and descriptions

## DESCRIPTION

Some EUtilities (`"epost"`, `"esearch"`, or `"elink"`) are able to retain information on the NCBI server under certain settings.  This information can be retrieved by using a **cookie**.  Here, the idea of the 'cookie' is similar to the 'cookie' set on a user's computer when browsing the Web.  XML data returned by these EUtilities, when applicable, is parsed for the cookie information (the 'WebEnv' and 'query\_key' tags to be specific)  The information along with other identifying data, such as the calling eutility, description of query, etc.) is stored as a Bio::DB::EUtilities::Cookie object in an internal queue.  These can be retrieved one at a time by using the next\_cookie method or all at once in an array using get\_all\_cookies.  Each cookie can then be 'fed', one at a time, to another EUtility object, thus enabling chained queries as demonstrated in the synopsis.

By default, a EUtilities object will retrieve records using a cookie if the cookie parameter is set.  Also, the object will use the database parameter stored in the Bio::DB::EUtilities::Cookie object when the parameter isn't set upon instantiation:

```
  my $efetch = Bio::DB::EUtilities->new(-cookie       => $elink->next_cookie,
                                        -rettype      => 'fasta');
```

ELink, in particular, is capable of returning multiple cookies based on the setting for the database; if `"db"` is set to `'all'`, you will retrieve a cookie for each database with related records.
