I have a group of cookies that start with the same name "order" each new cookies from this group is added+1 to each new cookies so for example "order1", "order2" and so on.
How could I check if "order3" exist without checking if order1 and two exist?
The reason I ask is because there could be an unlimited number of cookies with name "order.." but in the next minute there might be only one "order12" now if I need to check if "order12" exist I do the following while loop. I just dont think this is the most efficient way of doing it.
var i = 1;
while(true){
if(document.cookie.indexOf("order"+i+"=") >=0){//check if order number is empty
i++;
//Do something not smart!