Cookies are pieces of information that servers store in the client computer, persistently or temporarily. In modern web applications, cookies are the most common way of keeping track of the user's session. By saving session identifiers generated by the server stored in the user's computer, the server is able to distinguish between different requests made from different clients at the same time. When any request is sent to the server, the browser adds the cookie and then sends the request so that the server can distinguish the session based on the cookie.
In this recipe, we will see how to identify common vulnerabilities in cookies that would allow an attacker to hijack the session of a valid user.