A better idea is to use the URI fragment (the string after the # sign). It has the advantage of not having a size limit, and not needing to be sent all to the backend during the request. `window.location.hash` is your friend.
How to store your app's entire state in the url
141–150 of 416 posts
Re: How to store your app's entire state in the url
#142Re: How to store your app's entire state in the url
#143Re: How to store your app's entire state in the url
#144https://github.com/jncraton/box-line-text
The data representation could probably improve in terms of readability, but I'm happy with the way it provides a concise encoding while still including the text from the document directly:
https://box-line-text.netlify.app/#;c2121Hello;5321;c1341Hac...!
Re: How to store your app's entire state in the url
#145Earlier quoted context omitted.
The possible advantage of the encoding is that it that it can be encrypted and make parameter hacking impossible.
Harder. Not impossible. Harder. I don't want to make it sound like I am being disagreeable just for the sake of being disagreeable. If there is one thing the past decade has shown, it is that hacking is just a matter of time and whether a determined person is willing to direct resources at it.
What if they encrypted the parameters with a one-time pad ?
Re: How to store your app's entire state in the url
#146Re: How to store your app's entire state in the url
#147Earlier quoted context omitted.
I did once and was told off for adding noise to the discussion by someone who didn't see the irony of their complaint also adding to the noise.
If a one-time correction has its desired impact, the small addition to the noise reduces future noise.
Re: How to store your app's entire state in the url
#148Earlier quoted context omitted.
you could come up with a better compression scheme given that the dict keys and many of the values are probably common across everyone even if they don't repeat multiple times for a given user. a lot of flexibility would be lost though, and you would need to always update the scheme in a backwards-compatible way.
Once you've already given up on human-readability, it probably doesn't much matter how long/gross the result is. Rather than spending effort and adding complexity, just provide a built in URL shortener.
Re: How to store your app's entire state in the url
#149I remember when WebSphere Portal Server used to do this, and the URL would exceed 4096 characters, which was the limit that IE 6 (?) would support, breaking the entire site.