Change in permalink structure made javascript cookie not work correctly

From comment:

There is not enough information to answer your question. All your code is javascript, not PHP. Additionally, there is no function named “setCookie” or “getCookie” in javascript, and you don’t state what libraries you are using.

The answer is most likely that your setCookie function is using the current page path (cookies have a URL path component to them), and thus other pages on different URLs cannot access those cookies, but there’s no real way to tell without seeing that code as well.

For JS problems along these lines, you should try a different Stack, this is not a WordPress specific question, but a general javascript issue.