Obtaining and modifying cookies
Cookies are small pieces of information sent by a web server to the client (browser) to store some information locally, related to that specific user. In modern web applications, cookies are used to store user-specific data, such as color theme configuration, object arrangement preferences, previous activity, and (more importantly for us) the session identifiers.
In this recipe, we will use the browser's tools to see the cookies' values, how they are stored, and how to modify them.
Getting ready
Our vm_1
needs to be running. 192.168.56.11
will be used as the IP address for that machine and we will use Firefox as the web browser.
The Storage
tab in Developer Tools
may not be enabled by default in Firefox; to enable it, we open developer tools (F12 in the browser) and go to the Toolbox
options (the gear icon on the right). Under Default Developer Tools
, we tick the Storage
box.
How to do it...
To view and edit the value of cookies, we can use the browser's developer...