4 ms·
Oh, I see. For saving the form state, localStorage would work better than cookies for saving and restoring because then the information is only kept on the clie
by cpburns2009 9y ago
Oh, I see. For saving the form state, localStorage would work better than cookies for saving and restoring because then the information is only kept on the client. That still doesn't solve the multiple window problem, but that's likely less of an issue for a filling out a form than for navigation.
Cookies can certainly be set to never expire, but you don't know which window the cookie was intended for because the cookies are shared.
- ge96 9y agoI wasn't aware. Are you talking like HTML5? Haven't used local storage before. Thanks for the info.
- cpburns2009 9y agoYes, see Window.localStorage [1] and this short guide [2]. [1]: https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage https://developer.mozilla.org/en-US/docs/Web/API/Window/loca... [2]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage...
- ge96 9y agothanks for the references, I'd like to start using it at some point. Would be cool to check the client's device capabilities/run a specific event based on conditions met. I finally used memcache(d) so that's cool.