1

How would like to with javascript find a cookie that starts with 'AzureAppProxyAccess' and delete that cookie? It always has a series of random numbers at the end of the name. It is in the same domain so I have access to it. This is what I have tried with jquery but I would like just javascript.

for (cookie in $.cookie()) {
    if(cookie.substring(0, 19) === "AzureAppProxyAccess") { 
        $.removeCookie(cookie);
    } 
};
Oshadha
  • 530
  • 13
  • 24
llerdal
  • 379
  • 1
  • 3
  • 15

1 Answers1

0

You can use indexOf in strings.

cookie.indexOf('AzureAppProxyAccess') > 1 ? doSomething : somethingElse

Or, like it was said in one of the comments, use RegEx.

Baruch
  • 2,241
  • 1
  • 15
  • 26