Substring erase with certain pattern
Comment on Question
Can tell if your code matches the problem statement.
Because I can't understand the problem statement.
Input

&quot;VISITOR_INFO1_LIVE=USv90B-7CzI; LOGIN_INFO=e486e37a395be3f0e3b3237d090a6829c1oAAAB7IjQiOiAiREVMRUdBVEVEIiwgIjciOiAwLCAiMSI6IDEsICIzIjogMjAxMTk0MTMwNiwgIjgiOiA2MDgwMTg0NTEzNjQsICIxMCI6IDIzOTYyMTEyODczNH0=; PREF=f5=30;HSID=AHuJQBOVR0lQoRt_3; APISID=QaParXGsQcEPCzKg/A1smCfYrfMjxvfEPT; YSC=Vm3Amq5loFM&quot;;

Output

&quot;VISITOR_INFO1_LIVE=L80EDuHCEF8; PREF=f5=30&quot;;

Questions

Is the first and last quote and the last semi colon part of the input or just your formatting?
*SID (HSID,APISID here) upto ';'
I see none of these things in the output. there is no SID no HSID no APISID
Whey is  'VISITOR_INFO1_LIVE' in the output?
It is not specified as something you want in the output.
Why is PREF in the output.
This PREF=f5=30 seems like an illegal parameter. is = allowed in the parameter.

Review of code
OK. I assume there is a function wrapper here that defines str!! What is the type of str? I am going to assume char const* as you seem to be coding using C (rather than real C++). Types are super important in C++ please make sure we know all the types of all identifiers.
Why split up the declaration from the initialization?
 char *Cookie = NULL;
 ......
 Cookie = new char[strlen(str)];
 strncpy(Cookie,str,len);
 ......
 delete[] Cookie;

This just gives you the opportunity to misuse Cookie in the code. If you declare and initialize in the same statement then no misuse.
Also C++ code should never contain a delete (especially when you are learning). It should have very few calls (if any calls) to new. Dynamic memory management should be controled via an object. This is usually a smart pointer or a container depending on your usage.
Thirdly why use the C-String API. C++ has its own string that handles memory management for you and does a better job. Currently your code is not exception safe. An exception thrown in your code will result in leaked memory.
Thirdly you actually did it wrong and did not allocate enough space (you forgot to allocate space for the '\0' character that terminates a C-String). I know you used the strncpy to compensate for this. But all the other string functions are expecting it so something is likely to go wrong.
Forgot to check the result of a string function.
      p2 = strstr(p1,&quot;;&quot;)+1;

If strstr() returns NULL then we add 1 to it and now it is no longer NULL and your next test will always work. Even if it is not supposed too.
Are you sure the second test id correct?
      while((*ID != ';') &amp;&amp; (*ID != Cookie[0]) &amp;&amp; (*ID != ' ')){
           --ID;
      }

I think you are testing here *ID != Cookie[0] to make sure that you don't fall off the front of the string. But you are checking the content of the characters not the position of the pointers. A better test is (ID &gt; Cookie)