0

I'm using selenium to collect cookies, and here's the question: does cookies store information about selenium?

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
GeorgePhysics
  • 71
  • 1
  • 8

2 Answers2

0

You can check the cookies list by driver.manage().getCookies(); Return type is Set <Cookies>.

Hope this will help.

Villa_7
  • 508
  • 4
  • 14
0

No, cookies doesn't store information about Selenium.


Cookies

As per the article Privacy Concerns on Cookies, cookies are harmless. In it's basic form, are simple uncompiled text files that help coordinate the remote website servers and your browser to display the full range of features offered by the websites. These features may include hassle-free automatic logins and authentication, third party ad serving, ad management, preference settings, language settings, etc.


Tracking User Behavior

While cookies by themselves cannot dig or research your information or search your computer, they do store personal information in at least two ways:

  • Form information and
  • Ad tracking

This personal information is not generated by the cookies themselves but by your own input into website order forms, registration pages, payment pages, and other online forms.


Demonstration

A simple example to demonstrate the information stored by cookies using is as follows:

  • Code Block:

    import pickle
    import selenium.webdriver 
    import time
    
    driver = selenium.webdriver.Firefox()
    driver.get("http://www.google.com")
    pickle.dump( driver.get_cookies() , open(r'C:\Utility\testdata\my_cookies.pickle',"wb"))
    driver.quit()
    pickle_off = open(r'C:\Utility\testdata\my_cookies.pickle',"rb")
    personOut = pickle.load(pickle_off)
    print(list(personOut))
    
  • Console Output:

    [{'name': '1P_JAR', 'value': '2020-02-21-14', 'path': '/', 'domain': '.google.com', 'secure': True, 'httpOnly': False, 'expiry': 1584888349}, {'name': 'NID', 'value': '198=DCEMsfy3h6nZ0vpi6p3m3J-vVJpDlUBc7ItYE99kbFtr2fssl-1nVVXqF6joPREjrW-X8yxe5PnDqMNiVaVUd0NY8S_YOfksQdb-SzKSPUP5XumjlTjyTt_C8a5XSOmpUuXnOu-JCXHDe71fTe2KC-0kwb5B7_N7wSzM6Jrozqs', 'path': '/', 'domain': '.google.com', 'secure': True, 'httpOnly': True, 'expiry': 1598107549}]
    
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352