I am using wireshark to extract the cookie details. But wireshark only gives details like name of the cookie and value. asked 19 Apr '12, 07:30 Ashwin |
3 Answers:
If you mean the URL for which the cookie was set ("path" being a confusing word here, because that would mean the storage file on a lokal disk instead) you can tell by the URL that was requested together with the cookie. Cookies are set for certain URLs/URIs, so if you see a cookie coming in together with a GET/POST/...-Request, then it is set for that URL. Unfortunately you can't tell the base URL though unless you gather a ton of requests and determine the scope manually. For example if you see a cookie for http://www.test.com/whatever/ you can't tell if the Cookie was set for that exact path, or if it was set for a broader scope of http://www.test.com. But as soon as you see the same cookie coming back for http://www.test.com you know it was. It's usually easier to find a packet where the cookie was originally set, and read the scope from there. If you don't have that packet you have to determine it yourself. answered 19 Apr '12, 08:45 Jasper ♦♦ |
You don't read the path in Wireshark because that information is not transmitted across the network, so it doesn't appear in the data captured by Wireshark. The path to the location where cookies are stored depends on which operating system and browser you are using. A little Googling will turn up the location for your browser and OS. answered 19 Apr '12, 07:50 Jim Aragon |
Just to complicate things, it is allowable, although not common, for the same cookie name to be set for different URL domains and/or paths, with either the same or a different value. The result is that the browser considers each one to be an independent cookie. So if a cookie named status is set to the value "bar" at http://www.test.com/, and a second cookie named status is set to "fu" at http://www.test.com/whatever/, then when your browser goes to the first URL the status cookie will be "bar" but when you go to the second URL the server will get: status=fu and status=bar. It is up to the server at that point to figure out what to do! answered 19 Apr '12, 11:23 inetdog |