Forum Discussion

Maria123's avatar
Maria123
Icon for Altostratus rankAltostratus
Jul 15, 2019

Cookie handle with same name but different path

Suppose there are cookies with same name (for example testCookie)and different path , one with path /path1/path2 and another one with path "/".

So in this case if I use [HTTP::cookie exists "testCookie"] or [HTTP::cookie value "testCookie"], what cookie it will consider.

 

Is there any way to differentiate while getting the cookie value.

 

4 Replies

  • with HTTP::cookie path <name> you can get the path, you can then use that to differentiate

    • Maria123's avatar
      Maria123
      Icon for Altostratus rankAltostratus

      In HTTP Response I have sent the cookie with same name but different path based upon URL.

      But in the HTTP Request the cookie path always comes as blank if I use [HTTP::cookie path <name>]

      • boneyard's avatar
        boneyard
        Icon for MVP rankMVP

        have a look at what the browser receives, does it get the cookie with the correct path?

         

        it seems you are changing the cookies which are send to the browser. you are sure you don't do anything the browser doesn't understand?