Skip to content

Cookies

An abstraction to manage cookies on the current domain.

Accessing the object

1
2
3
app = FastRPA()
web = app.browse('https:...')
type(web.cookies)
Output
fastrpa.core.cookies.Cookies

Reference

Get the list of cookies on the current domain

web.cookies.list
Output
[Cookie(...), Cookie(...)]

Get the list of names from the cookies on the current domain

web.cookies.list_names
Output
['JSESSIONID', '_ga', ...]
'my_cookie' in web.cookies
Output
True
web.cookies.check('my_cookie', 'value')
Output
False
web.cookies.get('my_cookie')
Output
Cookie(name='...', value='...', domain='...', path='/', secure=True, http_only=True, same_site='Strict')
web.cookies.get('my_cookie')
Output
None
web.cookies.add('my_cookie', 'value')
Output
Cookie(name='my_cookie', value='value', domain='...', path='/', secure=False, http_only=True, same_site='Strict')
web.cookies.delete('my_cookie')