Storing persistent data in browser

前端 未结 5 1628
[愿得一人]
[愿得一人] 2020-12-11 23:05

For my web application, I need to store form inputs spanning across multiple pages, until I finally process/manipulate them to produce some results (its mostly formatting th

5条回答
  •  清歌不尽
    2020-12-11 23:41

    Generally cookies have a max size of 4k so you could store quite a bit of data in there.

    Be careful with validating all information that lives cookies - all the information resides on a client browser and can easily be manipulated by users of the site at any time.

    You didn't say which platform you use. Spring Webflow does exactly the kind of form processing that you want: http://www.springsource.org/webflow

    Even if you don't use Java you could use some of the principles.

    Edit: One more drawback of big/complex persistent cookies is that you have to make sure that any new code you deploy is backwards compatible with all the cookies that are out in the wild.

提交回复
热议问题