Some issues with encoding/decoding values for cookies

I need to save the current URL (which I get from Application.EXEname) in a cookie, to be able to go back to this URL from an other App (which resides on the same server).

When implementing this, I noticed the following: On setting the value for the cookie, the string for the value is automatically encoded by encodeURIComponent, but not decoded by decodeURIComponent when reading the cookie value. So is this intended? Perhaps it would be good to note this in the documentation.

From this discussion on stackoverflow I got the recommendation to encode/decode using window.btoa / atob functions. But with this, the read and then decoded value is not equal to the previous stored value - some additional characters are appended.

So, what would be best practice here?

You're correct that the class better uses decodeURIComponent when reading back the cookie.
So, this will be adapted this way in the next update.