Cookie Manager URI Error

Wappler Version : 2.6.4
Operating System : Windows 10

Actual behavior

Just added cookie manager from to the page. On loading the page in browser, its blank with error as below:
image

How to reproduce

On setting a break point on cookieManager.js (line 28), I found that its crashing on some other cookie that is present on the page.
The cookie is splitterposition=29%. This is how it looks like in console:

EDIT: Removing the % symbol from cookie’s value removes the error. But that was just to test.
Please fix the parsing here.

How was that cookie set? Almost all implementations (including us) use URL encoding inside cookies, that’s why we use decodeURIComponent when reading the value. A percent % is normally encoded as %25.

1 Like

I was not aware of url encoding being a standard approach to saving values in cookies.

This is coming from a custom js which I can change. Let me try it.

Was able to resolve the issue by adding encodeURIComponent and decodeURIComponent to the JS which was creating the cookie.
Thanks for the information. :slight_smile:

In the specifications it only tells to encoded: semicolon, comma, and white space. We use URL encoding because ASP, ASP.NET and PHP also encodes cookies in that way and we wanted to be compatible with that.

1 Like