Websites may set cookies for a variety of purposes, from identifying returning users to storing user preference information.
Capturing and saving the cookies a website sends is easily done with Page Interactions using the get_cookies
function. get_cookies
accepts a timeout parameter to set how long to listen for new cookies, as demonstrated below:
get_cookies returns an array of cookies with a variety of relevant metadata, as shown in the example below:
Copy ...
"render_flow" : {
"success" : true ,
"results" : [
{
"name" : "get_cookies" ,
"status" : "done" ,
"duration" : 2 ,
"result" : [
{
"name" : "AEC" ,
"value" : "AQTF6HyAslt2IuPBg9jwM2zCXxNUpsNKGgNwuplQWREeFgCJ5xXjYer98As" ,
"domain" : ".google.com" ,
"path" : "/" ,
"expires" : 1733227086.667467 ,
"size" : 62 ,
"httpOnly" : true ,
"secure" : true ,
"session" : false ,
"sameSite" : "Lax" ,
"priority" : "Medium" ,
"sameParty" : false ,
"sourceScheme" : "Secure" ,
"sourcePort" : 443
} ,
{
"name" : "receive-cookie-deprecation" ,
"value" : "1" ,
"domain" : "www.google.com" ,
"path" : "/" ,
"expires" : 1733227086.667547 ,
"size" : 27 ,
"httpOnly" : true ,
"secure" : true ,
"session" : false ,
"sameSite" : "None" ,
"priority" : "Medium" ,
"sameParty" : false ,
"sourceScheme" : "Secure" ,
"sourcePort" : 443 ,
"partitionKey" : "https://google.com"
} ,
{
"name" : "NID" ,
"value": "514=lxnGqrzAmosD7_7PmQUW-pU4qmlkut0tglTMPm3_T98VEVTulM6PgQWJW8RA4ayo0GKh3pIEP4cOET0JOn56PR2-rPD9nSrNzD_uKid8WQ3s_-WNjXpGs68BFpqHCRRnwG9OZBMi3NeGUYe2gE7pmIL1mkV_ryQDDcgcicdlthU",
"domain" : ".google.com" ,
"path" : "/" ,
"expires" : 1733486286.667576 ,
"size" : 178 ,
"httpOnly" : true ,
"secure" : true ,
"session" : false ,
"sameSite" : "None" ,
"priority" : "Medium" ,
"sameParty" : false ,
"sourceScheme" : "Secure" ,
"sourcePort" : 443
}
]
}
]
}